Fuse.Firebase icon indicating copy to clipboard operation
Fuse.Firebase copied to clipboard

APNS & Topics

Open cbaggers opened this issue 7 years ago • 2 comments

This PR builds on https://github.com/fuse-compound/Fuse.Firebase/pull/82 with the principle commit there fixed up according to the feedback from @kusma on the previous PR.

The following 2 commits add support for subscribing to topics and using APNS from Firebase.

The topic support is in this PR as I found it to be pretty much a prerequisite for handling APNS well due to the caveat noted next.

The caveat is that apns does not handle pure 'data messages' from firebase as one would hope. Therefore you should send data messages to android (as the Fuse integration requires it there) and notification messages to iOS. This was you get the same behavior on both platforms. To target the platforms separately I found it helpful to use the topics feature.

I also fixed up a few things I mentioned as being potential issues on the previous PR.

cbaggers avatar Sep 29 '18 19:09 cbaggers

The first was meant to be android only. Due to Firebase notifications being pretty much useless on android as they cant be delivered when the app is closed. Its designed to be used in conjunction with Fuse.APNS for those who want to handle both separately.

The second has implementations for Android and iOS and is intended to be used with Firebase's push via APNS feature (or whatever the official name is, I can look it up if needed).

The naming is crappy and I happy for that to change. I'd quite like to avoid the duplication too, perhaps detect when Fuse.APNS is in the build and not include the iOS function. However Fuse.Firebase and Fuse.APNS cant be used together if both try hooking into the same AppDelegate callbacks on the same build.

cbaggers avatar Sep 30 '18 15:09 cbaggers

On iOS I believe there's an issue with RegisterForPushNotifications being called before Fire.Core.Init.

Running our project with -FIRDebugEnabled it complains about not being configured. Calling Init at the start of RegisterForPushNotifications fixes this issue for me and I'm able to receive notifications.

I was also confused by OnRegistrationSucceedediOS which doesn't seem to be doing anything. Maybe the code should be removed?

I'll test this some more as I need push notifications for android and ios both inside and outside the app.

CapsAdmin avatar Jan 25 '19 21:01 CapsAdmin