-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add push notification support for expo #191
Conversation
6fe35e3
to
b81e919
Compare
b81e919
to
d8231c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
79fa862
to
cc01598
Compare
we're eagerly awaiting this feature! if it would be possible to release a new version with this included in the next few days that would be super appreciated 🙏 |
This is Christmas :D
For me, we don't need it to use push notifications |
@yonitou 👋🏻 |
Okay didn't know about that ! Maybe you could add it to the readme so people know why they're adding these new permissions ? (it's not always obvious :D) |
I also notice that in this PR, you're saying that there's no "deep links support". What does that mean exactly ?
|
@yonitou I'll need to get clarification on that. |
Alright :) keep me/us in touch. We'll need these infos to update to the last intercom version (we are currently stuck to v4 with the old config plugin 😅) |
Hi @yonitou, Also the following example creates a custom uri.
|
Hi |
Thanks for this feature, the timing on this was perfect for us and our use case! 🙌🏻 Tested on iOS and it works fantastically. However, testing on Android has proved to not be working. Taking a look at this PR, it looks like you have only implemented the config-plugin for iOS and not Android unless I am mistaken? I have run Am I possibly missing something, or is Android support still to come? Thanks! |
Similar to @nekode-dev, can confirm that iOS is working great here but so far we've been unable to get push notifications working on Android. @TheNerdGuyLulu is there anything extra we need to do in order to get Android working? |
Hi @josh- @nekode-dev 👋🏻 |
Hey @Br1an-Boyle, Appreciate the update on this, thanks for taking a look into it! 🙌🏻 |
Hello, It’s described in more details inside intercom documentation- steps 1 and 3. |
Can you confirm that inside MainApplication.kt, the API key isn’t being added? It should add the initialization method inside onCreate correctly filled with the data you gave on app.json. |
@TheNerdGuyLulu yeah that has been added, but this is specifically about the config needed to be added to allow for push notifications as outlined in step 2 of the docs - none of the code around calling |
@nekode-dev If you check the Android documentation, that is marked as optional. Necessary if you don't use firebase, or if you need custom logic attached to that action. RN doc is being revised and should be updated to include that information as well. |
Just chiming in here to say that in our app I can see the I've also ensured that the app name + bundle ID in the intercom settings match the app, and that the associated service account private key has been added to intercom. However we're still not receiving push notifications on android (while iOS is working fine). Any thoughts about what might be happening here? Happy to jump on a call or DM about this if that would be helpful too! |
@josh- |
I have Intercom on my Android app with the old expo config plugin so the SDK version is v4 but here's what I needed to do to make push notifications work on Android :
|
thanks @yonitou - think that's only related to this other expo plugin? tried using that locally with this expo plugin and doesn't appear to make a difference. here's a screenshot of App Info > Notifications showing that it seems this offical intercom plugin is correctly creating the three intercom notification channels ("Actions", "Chat replies" and "New chats"): (note that "Miscellaneous" above is for other non-intercom notifications in our app which are successfully being delivered) |
@TheNerdGuyLulu if I implement the following code: // note that we already use `@react-native-firebase/messaging` elsewhere in the app
import messaging from '@react-native-firebase/messaging';
messaging().setBackgroundMessageHandler((remoteMessage) => {
console.log(remoteMessage);
return Promise.resolve();
}); and then send an intercom message to my user while the app is in the background I see this function being invoked with this data: {
"data": {
"app_id": "<APP_ID_HERE>",
"app_name": "<APP_NAME_HERE> [TEST]",
"author_name": "Josh",
"avatar_color": "#333333",
"body": "Josh: Message test here",
"conversation_id": "26",
"conversation_part_id": "178",
"conversation_part_type": "comment",
"image_url": "",
"intercom_push_type": "notification",
"message": "Josh: Message test here",
"message_data": "{\"type\":\"text\",\"message\":\"Message test here\"}",
"receiver": "intercom_sdk"
},
"from": "814827852768",
"messageId": "0:1715816411767321%57dabaccf9fd7ecd",
"sentTime": 1715816411740,
"ttl": 2419200
} so it does appear that the underlying push notification code is working and the message is being received - however the user is not being notified with a notification message in their lock screen/notifications (as is correctly working in the ios app build) do you know why this might be the case? I created another internal distribution build that didn't contain (I also note that this intercom notification doesn't have a |
Hi ! @Br1an-Boyle : except the discussion happening about the Android part (which is quite important for us to use your expo plugin), did you get some clarifications about the do and don't regarding push notfications setup and deep linking (especially for people who come from the old plugin with intercom v4) ? That would be really helpful to get ready and understand what works or not ! |
I created a new expo project from scratch. The push notifications works fine for me. For this test I enabled the notifications permission directly from the android settings, but while developing the plugin I used the react-native-permissions and also fine. I'm happy to jump on a call to try to sort it out. |
Thanks very much for verifying and the offer to jump on a call @TheNerdGuyLulu, however since we need to support badging the app icon when receiving a notification (and this isn't supported by intercom) we've instead moved to listening to Intercom webhooks and sending our own notifications. |
So looks like that this thread can be closed if everything works as expected ? @TheNerdGuyLulu, what about deep links setup in push notifications ? |
Hi I'm updating this thread because I still have questions about push notifications and deep link support and especially, the differences between the old plugin and the new one.
Can I have some help/explanations about that ? I carefully read the repository documentation but I don't know if it's exhaustive or not Thanks ! |
Hey @yonitou 👋 |
I was waiting for your answer before updating my plugin. I can try with your readme but I still don't understand how should I handle deep links ? Is it going to be managed by the |
Hey @yonitou As for waiting for the authentication to finish, I don't think we have an interceptor method in our plugin yet but I would have to get back to you on this. Thanks for being patient 😄 |
Thx
I didn't use any interceptor but I blocked the notification with expo-notifications package, read the data inside and navigated manually instead. It was quite hacky but worked :D |
Yes, I think it could but it would be best to test it out first 😄 |
I just tried to install the new plugin following the readme :
Any idea ? PS : FYI, I have a working setup for deep links and universal links for Android & iOS with Expo & React Navigation for one year now so I don't think it's related to it. |
Here's what I need to do to handle push notifications & deep links the same way for Android & iOS with
I tried on a real iOS device and on an Android simulator. |
Up :) |
Why?
Towards https://github.com/intercom/intercom/issues/328801