Cordova plugin - 404 on every requests problem (xcode 10.0 - ios12)


#1

Hi,

First of all, thank you for your awesome work, and the fact that you provide a cordova plugin.
But I’m having troubles to make the ios intercom-cordova plugin work.

I have such a stack:
Cordova CLI 8.0.0
cordova-ios 4.5.5
cordova-plugin-whitelist 1.3.3
cordova-plugin-wkwebview-engine 1.1.4
cordova-plugin-wkwebview-file-xhr 2.1.1

I’m using your latest intercom-cordova 6.1.0, with the latest xcode 10.0, and system ruby 2.3.7p456.
I have tested this on ios11 and ios12.

Everything is building properly without errors, and I can successfully package our ios app with the intercom bundle and intercom-cordova-plugin. I’ve also generated an ios-sdk api key, so everything seems to be ok, and at startup, the app correctly shows the intercom icon.

The problem is that I get these kinds of errors/traces in xcode :

[Intercom] ERROR - Tried to update user but there was a network error (404) - Request failed: not found (404)

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

So basically, the intercom widget stay empty because the loading of your content fails.
Do you have any suggestions about why it could not load intercom content?

I’ve tested the Example cordova app from https://github.com/intercom/intercom-cordova, and I get the same error 404, using my api keys and app id in the example app!

I even added explicit wild card in the config.xml :

<access origin="*" />
<allow-intent href="*" />
<allow-navigation href="*" />

What could cause these 404 errors on all requests from the intercom plugin / sdk ?
Thank you,


#2

Hi Yann! That’s a bit strange.

Could you try unregistering the current session with intercom.logout(); https://developers.intercom.com/installing-intercom/docs/cordova-phonegap-installation#section-how-to-unregister-a-user and then registering the new user again?

It could be that your app had a previous user session and it is still trying to connect as that user. Perhaps that user account was permanently deleted or blocked

If you’re still experiencing the problem, perhaps share with us the app_id you’re using so we can look at our logs. It may be best to contact us via the Intercom Messenger / email team@intercom.io so we can debug this and look at any of your logs when you reply as well

I’ve managed to get the current example Cordova app running with iOS 12 with Xcode 10 show here