tinycreative / react-native-intercom

React Native wrapper for Intercom.io
MIT License
406 stars 280 forks source link

Tried to fetch the homescreen but there was a network error (409) #389

Closed thecodecafe closed 2 years ago

thecodecafe commented 4 years ago

Hi, please I've followed the docs and implemented this library and it works perfectly on Android but I keep getting a blank screen when the messenger loads on iOS.

When I launched the app from XCode I see the following message in the console on XCode.

[Intercom] ERROR - Tried to fetch the homescreen but there was a network error (409) - Request failed: conflict (409)

Here's the code I run when launching the messenger.

// register identified user
await Intercom.registerIdentifiedUser({
  email: email,
});
// set user info
await Intercom.updateUser({
  name: first_name + ' ' + last_name,
});
// display intercom
await Intercom.displayMessenger();

Can't really find what the cause of this problem is, can anyone help me out?

hemche commented 4 years ago

Did you happen to check this out. Though it is cordova related question, you can try the solution mentioned. https://community.intercom.com/t/cordova-plugin-404-on-every-requests-problem-xcode-10-0-ios12/770/2

thecodecafe commented 4 years ago

Hi, @hemche thanks so much for the article you shared, what I had to do however to get this working was to register as an unidentified user and then update the user's info, this worked for me, although I noticed that when I register as an identified user with the user ID and not email it also works, what I have work's right now so I think I'm ok.

I'm not entirely sure of what the problem was but when registering as an identified user using an email address I get this error. [Intercom] ERROR - Tried to fetch the homescreen but there was a network error (409) - Request failed: conflict (409)

For anyone who might have encountered this problem, please find the code below that worked for me.

// register identified user
await Intercom.registerUnidentifiedUser();
// set user info
await Intercom.updateUser({
  user_id: String(id),
  name: first_name + ' ' + last_name,
  email: email,
});

Gracias! ✌️

Mai-Hong-Son commented 3 years ago

Same problem. Please, help me fix it!!! :(

osikes commented 3 years ago

Not sure, if there's anyone still out there with this issue. But in my case, getting either 409 or 401 was result of the 'identity verification' settings being enabled for iOS and android.

JulianKingman commented 3 years ago

@osikes could you be more specific? Which identity verification settings were causing the problem, and how do I change them? Do you mean "login with face id", two-factor authentication, or something else? Thanks!

JulianKingman commented 3 years ago

Oh I see, intercom identity verification settings: https://developers.intercom.com/installing-intercom/docs/react-native-identity-verification