Closed HelenaSewell closed 6 years ago
Hi!
Where is initPushNotifications()
called? Is it run every time you run the app?
Yes, every time the logged-in section of the app is reached.
That's odd - I've used your code and it seems to be working fine. One thing I'd do however is to instantiate Pusher once per application and then reuse it everywhere. (Unsubscribing from interests won't work otherwise)
What kind of notifications are you sending - is it using the data
or notification
payload?
Also - are you seeing this kind of logs when you send pushes:
D/PFCMListenerService: Received from FCM: com.google.firebase.messaging.RemoteMessage@999ec6c
This should be our the Pusher library logging every single notification it receives. My suspicion is that your listener instance gets destroyed and then it won't log anything for you.
On the first launch of the app with the library added, the push notification was received just fine in the FCMListener. However, from this point on, no matter whether the app was in the foreground or background, I got no further notifications. The subscription seemed to work just fine, but no notifications came through. When I cleared the app's data, I got one notification again, and then nothing. I can see the notifications turning up in the Pusher dashboard, but not in the app. I also tried using a custom Service but that had the same effect.
Apologies if my code is incorrect and is causing the issue, but I don't see how it could be causing the effects I'm seeing.