capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

Push Notifications

Open JStumpp opened this issue 8 years ago • 43 comments

Push notification is very often required in apps. Any plans on implementing this? The optimal solution would be to have a unified api for PWA, iOS, Android and Electron. The Phonegap plugin push is a good reference: https://github.com/phonegap/phonegap-plugin-push

I think the best idea would be to use the Firebase Cloud Messaging for all platforms which simplifies the code to write on the server-side.

JStumpp avatar Mar 26 '18 14:03 JStumpp

Yea we're thinking about how to do that right now. As for FCM, I have some hesitations. For one, I don't want to exclude apps that are using APNS directly, but maybe it does make it a lot simpler?

mlynch avatar Mar 26 '18 21:03 mlynch

Going to prioritize this because it's probably going to be a show stopper for anyone using Capacitor f it doesn't have easy Push support out of the box, and the existing PhoneGap one doesn't play well with Capacitor yet

mlynch avatar Mar 26 '18 22:03 mlynch

Onesignal is a best option

edy-ap avatar Mar 27 '18 17:03 edy-ap

why?

jcesarmobile avatar Mar 27 '18 17:03 jcesarmobile

https://mobilejazz.com/blog/push-notifications-firebase-vs-onesignal/

Only for push notifications is better

edy-ap avatar Mar 27 '18 17:03 edy-ap

Since there are so many 3rd party options out there, our push support should try to support the native SDKs and services provided by Apple and Google. We would love to see Onesignal as a plugin option but we're not going to bake it into the official plugin at this time

mlynch avatar Mar 27 '18 17:03 mlynch

but could you support it as a cordova plugin?

edy-ap avatar Mar 27 '18 17:03 edy-ap

It doesn't work at the moment, I've fixed several issues it had, but more issues keep coming, so I wouldn't put my hopes on it.

jcesarmobile avatar Mar 27 '18 17:03 jcesarmobile

I will continue testing and try to solve some errors, by the way I see that Capacitor 1.0.0 Alpha, yeaaa!

edy-ap avatar Mar 27 '18 17:03 edy-ap

Most of the people who are using ionic/cordova app are using phonegap push plugin To start I tkink it could be a good idea to take this one even if it uses fcm. And next add apns support.

speedfl avatar Mar 28 '18 06:03 speedfl

phonegap push plugin still uses APNs as default, FCM only if you provide the FCM configuration .plist file.

jcesarmobile avatar Mar 28 '18 08:03 jcesarmobile

I'm currently using phonegap push plugin for an app I built with ionic for android and iOS, I use FCM for this (having a GoogleServices.json for Android and .plist for iOS), having just recently heard of capacitor I've been trying it out but currently blocked at making it work with the phonegap-push-plugin v2.0.0 and v2.1.2 (build issues for android). Hopefully if it isn't currently supported then it will be supported soon so I can continue working with it. 👍

iranicus avatar Apr 09 '18 11:04 iranicus

Hi, this is a showstopper for us. If there is no support for push notifications yet we will have to use cordova meanwhile. I will be glad to try some experimental plugin for capacitor if it's available. Is there an ETA for this feature?

Thanks.

adrm avatar May 17 '18 09:05 adrm

We are planning on leveraging Capacitor to wrap our PWA and are specifically targeting iOS. We require Push Notification functionality. Our engineering team is happy to pitch in on the development of it. We would like to know the status of this internally, obviously we don't want to step on any toes or reinvent the wheel. @mlynch I noticed that you marked it for Beta 2 what is the time line on this, what do you need? We can dedicate 1 or 2 engineers for a few weeks to punch this out ... send me a message.

jjviscomi avatar Jun 15 '18 19:06 jjviscomi

I have used the cordova-fcm-plugin - it's far more easier, i just modified. (https://github.com/fssrepository/cordova-plugin-fcm-modified) - i had no test device, but it's very lightweight. (just a pure clone from what the firebase android-start project has)

If we use fcm or apns, then it can be done in some hours, even if you don't know Swift. If you would like to create from scratch it would take some time.

To me is not needed, as my app is using mqtt at the end. Needs a little bit more than what the notification can do.

Unfortunately to integrate fcm to the base product is not a good idea, as it's very heavy.

To be honest the cordova world is very scattered, and i think we need to group plugins in one. For example some common what every app contains. (auth / push etc. in one - it does not take too much space)

ghost avatar Jul 02 '18 21:07 ghost

I am currently using the PushNotification Plugin of Capacitator beta.7. This works great on Android. On iOS I see this in the logs:

⚡️ To Native -> PushNotifications register 62318285 ⚡️ TO JS {}

So registering the push functionality works. But PushNotifications.addListener('registration', token => { never receives a token on iOS.

bartslootweg avatar Aug 28 '18 20:08 bartslootweg

registrationError is never called as well

bartslootweg avatar Aug 28 '18 20:08 bartslootweg

Did you enable push capabilities in Xcode?

jcesarmobile avatar Aug 28 '18 20:08 jcesarmobile

Yes I did.

screen shot 2018-08-29 at 08 57 14

bartslootweg avatar Aug 29 '18 06:08 bartslootweg

Can you create a new issue and provide the information there? Like code you are using or a sample app if possible

jcesarmobile avatar Aug 29 '18 07:08 jcesarmobile