capacitor-community / capacitor-community/intercom
Push notifications not working for Android
- Dominant language
- Java
- Stars
- 70
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I'm unable to get push notifications working on Android. I'm guessing this is a config/setup issue, but since this issue has come up a few times I was hoping to get it working and then contribute better instructions to this repo.
**To Reproduce**
1. Install and configure [@capacitor/push-notifications](https://capacitorjs.com/docs/apis/push-notifications)
2. Enable Cloud Messaging API in Firebase (legacy) and add the Server key to Intercom (Settings > Install > Android > Push)
3. Install and configure this plugin
4. Add app code:
```
import { Intercom } from '@capacitor-community/intercom';
import { PushNotifications } from '@capacitor/push-notifications';
PushNotifications.requestPermissions();
PushNotifications.register();
Intercom.registerUnidentifiedUser();
Intercom.displayLauncher();
```
6. Launch app > send Intercom message > close the app > reply to the message from the Intercom Inbox
Expected: Receive a push notification on the device after ~10 seconds.
Result: Nothing. The message comes through as expected if you resume the app.
**Additional context**
- I confirmed the device/app can receive push notifications via a manual Firebase Cloud Messaging notification to the registration token
- Push works on iOS as expected
- Confirmed the app has notification permissions enabled
- Tested on multiple devices with the app installed both via Android Studio and via Internal app sharing on the Play Store
**Platforms:**
- OS: Android, various devices/versions
Any help greatly appreciated!
Contributor guide
Assessment
This issue has not been assessed yet.