The avatar attribute does not work for me | Community
Skip to main content
Answered

The avatar attribute does not work for me

  • Oct 12, 2022 8:34 PM UTC
  • 6 replies
  • 434 views

I am using react native and I am using the following code:

 

Intercom.updateUser({

  email: userInfo.email ?? '',

  userId: userInfo.id,

  name: (userInfo && userInfo.first_name) ?? '',

  phone: userInfo.phones[0].number,

  avatar: 'https://www.w3schools.com/howto/img_avatar.png',

  custom_attributes: {

     date_of_birth: userInfo.dob ?? '',

     user_connected_from: App'

  }

})

 

EVERYTHING, absolutely everything works, except the avatar attribute, could you please tell me how to make that image be my client's profile picture here in the red circle? Thank you.

where it should go profile image

Best answer by Zak

Hey! Sorry for the delay, missed this one.

 

So I was testing this and thought I ran into a big issue with a bug where updating would create a new account instead of updating the existing, but realized I was sending a POST request instead of PUT haha.

 

I'm not familiar with coding in react unfortunately, however I've tested sending an API request to update a profile and was able to successfully update the profile image. I even used the one you provided just to test, so that works fine.

 

So API wise it appears to be okay, but perhaps this is an issue unique to using it via react? Could you try and perform the same command via a regular API request instead to see if you have the same issue?

View original

6 replies

Forum|alt.badge.img+1
  • Active User
  • Oct 13, 2022 1:08 AM UTC

Around the URL you have single quotes; can you try change it to double quotes and see if that makes any difference?


  • Author
  • New Participant
  • Oct 13, 2022 1:16 PM UTC

Hello.

Still not working, does it work for you?


Dianah Tripac
Intercom Team
Forum|alt.badge.img+3
  • Leading the Community @ Fin
  • Oct 20, 2022 4:17 PM UTC

Hi @zak p​ , just wondering if you can further advise the user on this matter. 🙌


Forum|alt.badge.img+1
  • Active User
  • Answer
  • Oct 21, 2022 5:11 AM UTC

Hey! Sorry for the delay, missed this one.

 

So I was testing this and thought I ran into a big issue with a bug where updating would create a new account instead of updating the existing, but realized I was sending a POST request instead of PUT haha.

 

I'm not familiar with coding in react unfortunately, however I've tested sending an API request to update a profile and was able to successfully update the profile image. I even used the one you provided just to test, so that works fine.

 

So API wise it appears to be okay, but perhaps this is an issue unique to using it via react? Could you try and perform the same command via a regular API request instead to see if you have the same issue?


  • Author
  • New Participant
  • Oct 24, 2022 5:26 PM UTC

Thank you very much for your response.

 

I have been to support and they told me the same as you said and it worked fine with the api request. But I need it with react native.

 

Apart from that because they ask for an external_id to do the avatar update in the api, but I don't have that with Intercom in react native, which means building another additional call from the users....

 

The right thing would be that obviously it would work from the library they have created for react native, that's what it was created for. 

 

Here is the documentation about react native

https://developers.intercom.com/installing-intercom/docs/react-native-configuration/p>


Brandon Foret
  • New Participant
  • Jan 14, 2024 10:09 PM UTC

I can’t seem to find the correct attribute key to update this information through Zapier