Hello!
I want to add Intercom’s chat feature in my app. I have followed some guides: https://github.com/intercom/intercom-cordova, https://ionicframework.com/docs/native/intercom/ and Intercom’s own guide, however I can’t get it to work.
If you have done this before you’ll know that you need to add this first:
<preference name="intercom-app-id" value="APP-ID"></preference>
<preference name="intercom-ios-api-key" value="ios_sdk-API"></preference>
<preference name="intercom-android-api-key" value="android_sdk-API2"></preference>
In your cofig.xml
which I’ve done, but the second step doesn’t want to work out for me. And the second step is to add some functions in order to make Intercom to work. Here’s one of them:
onDeviceReady: function() {
if(loggedIn){
// We're logged in, we can register the user with Intercom
intercom.registerIdentifiedUser({userId: "123456"});
}
}
This function should be placed where the app launches. And if I’m not wrong here is where it should be placed:
$ionicPlatform.ready(function () {
I’ve been struggling with this the whole day and I just want this to work. I want this feature to work with logged in users ONLY by the way. If someone has any clue on how to do this I would be really, really happy.
Thank you for reading.