I managed to integrate the iphone push notifications but somehow it wasn't so easy for the Android. I guess this is probably since i am a newbee for android and mobile dev.
The app is compiling but no push notification are displayed. I checked the errors from the logcat and found the following error:
intercom-sdk-gcm module not found
I am not sure how to add this module to the gradle file, since just adding it
dependencies {
compile project(':react-native-intercom')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-vector-icons')
compile project(':react-native-maps')
compile project(':react-native-share')
compile project(':intercom-sdk-gcm') // <-- i add this
}
throws an error Project with path ':intercom-sdk-gcm' could not be found in project ':app'.
what am i doing wrong? Isn't the react-native-intercom adds the gcm module already?
Any news about this?
I managed to solve this.
I manually downloaded the intercom sdk and placed it in the lib folder, like so:

and add it to the dependencies in the app gradle:
dependencies {
compile project(':react-native-intercom')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-vector-icons')
compile project(':react-native-maps')
compile project(':react-native-share')
compile(name:'intercom-sdk-gcm-1.1.19', ext:'aar') // <--- add this
}
part of that, just make sure you do all the instructions from the documentation and it should be ok.
@mrharel Yes, that is a requirement. We do not ship with the intercom library intentionally. However many people have been feeling the pain of that so I may consider it.
I've never used the android version of react-native-intercom and don't do much android work so I couldn't have been much help here.
@mrharel I follow the instructions of intercom to configure sdk for GCM. Is there anything else needed to do?
I did all the instructions and still are not getting this working with intercom, I am trying to call Intercom.registerForPush after I registered a identified user on intercom, but this is throwing an error saying that this method does not exists for IntercomWrapper.
I'm getting a similar error: undefined is not a function (evaluating IntercomWrapper.registerForPush(function(error) { ...
Edit: the .aar files can be found here.
I still can't get push notifications working.
compile ('io.intercom.android:intercom-sdk-gcm:1.+@aar') to my build.graddlestrings.xmlIntercomWrapper.registerForPush, but realised it wasn't implemented in react-native-intercom/.../IntercomModule.java.The ENABLED PUSH MESSAGING field in Intercom is still set to unknown and I can't send push notifications to android users ...
Has anyone managed to get it working ? Did I miss something ?
Same here with yazgazan. Although I can register - unregister user. I haven't been able to enable push notifications. I suspect this has to do with the successfull reception and registration of the device token from GCM to Intercom
I ended up making my own integration for android, using the latest version of the Intercom sdk (3.+). This is less than ideal since we are still using the react-native-intercom package for iOS, which uses the 1.+ version of Intercom. That's not really a solution, nor a particularly beautiful workaround, but that's the easiest solution to implement I could think of.
@yazgazan Thank you for the insight.
@yazgazan Would you like showing us how to achieve the same? Thanks!
It's not really "the same", since I only implemented the featured I needed.
Here is a gist with the java bridge and javascript helpers : https://gist.github.com/yazgazan/f0a96d298bb651dd31aec1cfc056fed1
@yazgazan Thanks a lot! This is a good starting point at least, appreciated.
@browniefed Are there any plans to support Android with Intercom 3+ straight from this package? Thanks!
I am also a little confused, do we need to do everything that "intercom-android" package says OR you have most of its instructions integrated to your package?
I just got GCM pushes working.
The intercom installation docs for Android gives you 3 options:

This package is using:
compile ('io.intercom.android:intercom-sdk-base:3.+')
Which corresponds to the Option 3 in the Intercom Docs: the SDK without Push notification support.
To fix this I added this to my android/app/build.gradle:
dependencies {
compile project(':react-native-intercom') // this was added by react-native link
compile 'io.intercom.android:intercom-sdk-gcm:3.+' // <= ADD THIS for GCM support
// ...
}
I hope this helps more people.
Maybe we could add this to the readme?
Does this support intercom 4? I'm getting the same bug with
compile 'io.intercom.android:intercom-sdk-base:4.+'
compile 'io.intercom.android:intercom-sdk-fcm:4.+'
Either I'm blind, or there is NO method named registerForPush in https://github.com/tinycreative/react-native-intercom/blob/master/android/src/main/java/com/robinpowered/react/Intercom/IntercomModule.java
@mtkopone you don't need to register for push notifications in android. You only need to send the gcm sender id/firebase token to intercom
and if my senderid is in the strings.xml file and the serverkey in intercom, things should just work?
I think. I've only setup fcm properly see here https://github.com/tinycreative/react-native-intercom/issues/157. I had to do something similar to Step 7 in the gcm setup here https://developers.intercom.com/docs/android-gcm-push-notifications. I'd follow what intercom says (not this repo)
@mtkopone you don't need to register for push notifications in android. You only need to send the gcm sender id/firebase token to intercom
I wish the library did the check internally, and just disregarded the call for Android or made it automatically for iOs
The docs do say it's required for iOs, but _doesn't_ mention that it would effectively kill your Android runtime
Most helpful comment
@mrharel I follow the instructions of intercom to configure sdk for GCM. Is there anything else needed to do?
I did all the instructions and still are not getting this working with intercom, I am trying to call
Intercom.registerForPushafter I registered a identified user on intercom, but this is throwing an error saying that this method does not exists for IntercomWrapper.