Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Support for Push Notifications #54

Closed
jlooper opened this issue Jun 14, 2016 · 21 comments
Closed

Support for Push Notifications #54

jlooper opened this issue Jun 14, 2016 · 21 comments

Comments

@jlooper
Copy link
Contributor

jlooper commented Jun 14, 2016

I know push is a big fat pain but I feel like, by leveraging Firebase, we can avoid at least two or three extra plugin installations by supporting the build-in power of Firebase 3.0. Just want to put on your radar screen support for the new Firebase Cloud Messaging which is essentially rebranded GCM. Maybe we could reuse some GCM integration borrowed from the current NativeScript Push plugin.

Thanks Eddy!

@EddyVerbruggen
Copy link
Owner

Wow, FCM is a step up from GCM configuration-wise. Certainly considering this!

@jlooper
Copy link
Contributor Author

jlooper commented Jun 20, 2016

I know, and the whole cross platform story is super compelling...

@EddyVerbruggen
Copy link
Owner

Getting somewhere!

Note that iOS certificate hell is still as bad as ever.

img_7343

img_7342

img_7341

@EddyVerbruggen
Copy link
Owner

Update: iOS 10 had some push / badge issues that delayed my work a bit. I'm just assuming those are pre-beta issues that will be ironed out, so testing this baby with iOS 9 for now and it starts to look super good!

@bfv
Copy link

bfv commented Jun 25, 2016

My hands are itching to get to work with this! Any idea when there will be something "releasable"?

@EddyVerbruggen
Copy link
Owner

Ha, @bfv, you can expect iOS support to land today. I'm doing the final tests and have to document it. You can prepare yourself by going through certificate hell (add the push entitlement to your appid at the iOS developer center, add the push certificates to it, upload those certs to the firebase console, generate and download new provisioning profiles - basically this).

Android support will follow shortly after, but once you've got iOS running that will be a breeze to add.

@EddyVerbruggen
Copy link
Owner

@bfv go ahead and grab it from github.. not on npm yet. Working on Android support currently.

@jlooper
Copy link
Contributor Author

jlooper commented Jun 25, 2016

So amped for this!

@bfv
Copy link

bfv commented Jun 26, 2016

I wait a little longer for the Android support. Keep up the good work!

@EddyVerbruggen
Copy link
Owner

Android support just landed! 🚀

Tagging and releasing 3.3.0 right now, see the new docs on how to use it.

@EddyVerbruggen
Copy link
Owner

EddyVerbruggen commented Jun 26, 2016

Btw, I recommend removing and adding the Android platform since I figured out which bits of the play services libs were really needed on Android (thanks Google for not documenting that) - should help ppl not running into multiDex issues in the future. Don't forget to re-add the two gradle afterwards bits as mentioned in the readme.

Also, I've made wiring Facebook and Cloud messaging as easy as possible for the developer, the only thing that's required is doing this in app.js.

@jlooper
Copy link
Contributor Author

jlooper commented Jun 26, 2016

Fantastic, Eddy! 👏🏻👏🏻👏🏻👏🏻👏🏻

@bfv
Copy link

bfv commented Jun 27, 2016

It works! Thanks!

@pap5508
Copy link

pap5508 commented Feb 2, 2017

I am looking for Nativescript Firebase Push Notification demo sample.. Anyone please help ??

@pap5508
Copy link

pap5508 commented Feb 2, 2017

firebase.init( { iOSEmulatorFlush: true, onPushTokenReceivedCallback (token){ console.log("Push Token: "+ token); } onMessageReceivedCallback: function(message) { alert(message.title+""); this.router.navigate(["/main-menu"]); } }).then( (instance) => { console.log("firebase.init done"); }, (error) => { console.log("firebase.init error: " + error); });
How can I send push token to Own backend Server.. ??

@asaph26
Copy link

asaph26 commented Feb 2, 2017

@pap5508 You can send the token to the backend by utilising the onPushTokenReceivedCallback callback inside the init method.

onPushTokenReceivedCallback (token){ 
    //send the token to the backend. You might also want to add some additional information such as the user details in case you want to target notifications to the a specific user
}

@jlooper
Copy link
Contributor Author

jlooper commented Feb 2, 2017

I'm working on a blogpost about this, please stay tuned and watch for it in the NativeScript blog!

@pap5508
Copy link

pap5508 commented Feb 7, 2017

@jlooper : Have u completed your blog..???

@jlooper
Copy link
Contributor Author

jlooper commented Feb 7, 2017

@pap5508 working on it for next week, thanks

@pap5508
Copy link

pap5508 commented Feb 7, 2017 via email

@URvesh109
Copy link

Firebase Cloud Messaging (FCM) get always prompt though no message is send with nativescript webpack plugin, but work gud without nativescript webpack plugin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants