capacitor-community / fcm

Enable Firebase Cloud Messaging for Capacitor apps
https://capacitor.ionicframework.com/docs/
MIT License
238 stars 83 forks source link

question: How does this library compare versus the official `@capacitor/push-notifications` plugin? #115

Closed tafelnl closed 1 year ago

tafelnl commented 1 year ago

I am confused as to what the benefit is for using this library over the official @capacitor/push-notifications plugin.

I tried to look for it in the docs/issues, and the only thing I found about it was this comment (https://github.com/capacitor-community/fcm/issues/11#issuecomment-515796247) of you (@stewones) saying

Capacitor will never send you fcm tokens, that’s why I created this plugin.

But, actually, the Capacitor plugin does support retrieving the token (maybe it wasn't at the time of your writing, but it is now): https://capacitorjs.com/docs/apis/push-notifications#token

So that leaves me wondering: what is the benefit of this plugin?

allard-potma commented 1 year ago

The official does not support subscribing to topics (yet).

jcesarmobile commented 1 year ago

@capacitor/push-notifications uses FCM on Android and APNS on iOS @capacitor-community/fcm uses FCM on both Android and iOS

The token you linked is going to be an APNS token on iOS, unless you follow this guide to integrate FCM into your iOS app, that would make it possible to get a FCM token on iOS without needing @capacitor-community/fcm.

@capacitor-community/fcm has some methods that @capacitor/push-notifications doesn't have, like the mentioned about subscribing to topics.

stewones commented 1 year ago

Thanks for explaining @jcesarmobile