Device Token Capture & send notification

Hey everyone, I,m develop an app. In app my requirement is sent a notifications to registered persons by capturing device token. i’m trying to capture device token with these commands mentioned below

           ionic add ionic-platform-web-client
           ionic plugin add phonegap-plugin-push
           ionic io init
           ionic config set dev_push true

but i’m got the ionic token only.unable to got device token with these commands . please help to solve this Issue

Thanks in advance …

Well … I’m not using ionic push … but ngcordova … maybe it helps?

to get the device token see the manual

Thanks for your reply

I’m trying with this code but it not works

@nani_madepalli Hi, i provided full instructions to set up ionic-push-notification here: Ionic is not defined when using ionic-push

Hey, @Devniz i’m trying with code what sent by you, i’m test the app in android only,it works in android device which have playstore in device. in other devices push an error like"MISSING_INSTANCEID_SERVICE". how to get device token token of the devices those don’t have playstore. please send the solution if you know …


@nani_madepalli You seriously need to read the documentation of cordova-plugin-push, because everything is there. MISSING_INSTANCEID_SERVICE is the error related to a missing service for iOS or Android.

To get the registerId:

push.on(‘registration’, function(data) {
alert(data.registrationId); //You will need this register Id to push on the server-side.

1 Like