capacitor-community / capacitor-community/intercom

Push notifications not working for Android

Open
#87 18 comments 6 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.