3 Replies Latest reply on Sep 13, 2017 3:14 AM by leadMobileDev2017

    Push Notifications: Registration ID undefined

    jlaskowski1016 Level 1

      The tutorial for push notifications worked fine for me: running PG Desktop on my Mac, running the PG app on my iPhone 7, connecting the phone app to the server on the Mac, then sending the push notification from my Mac using the phonegap push command given in the tutorial.   I get the pushed notification as expected.  I then replaced the console.log call that logs the registrationID (used for the deviceID param of the push command) with an alert.  I ran it again and the alert showed the registrationID.

       

      I then uploaded the app to the Phone Gap Build website, built it, installed it on my iPhone and ran it.  The registration ID comes back as "undefined."

      I changed replaced the console.log call with an alert in the error handler and ran it again.  The error handler was never called.

        • 1. Re: Push Notifications: Registration ID undefined
          jlaskowski1016 Level 1

          I figured out how to look at the console.log output using Xcode and I can see that there is a registrationID in the log.  I'm not sure why the alerts showed undefined, but that's a moot issue now. 

           

          So, I took the registration ID in the log, used the same exact "phonegap push" command-line command used in the tutorial, but replacing the deviceID param's value.  I didn't receive any notification on my iPhone.   I assume it has to do with the certificate needed to send the notification.   I was able to send a notification to the app using the Java PNS library which, the call of which does point to the certificate.

          • 2. Re: Push Notifications: Registration ID undefined
            José Jesús Pérez Rivas Adobe Community Professional (Moderator)

            Hi

             

            Your project works with PhoneGap Developer App because it uses a compilation certificate and other certificate for push notifications. These certificates have been generated by Adobe to be able to perform the tests.

             

            You need access the "member center iOS", create a certificate and provisioning compilation and a certificate for push notifications. Then you will have to use this last certificate for from nodejs to send your push notifications.

             

            Regards!

            • 3. Re: Push Notifications: Registration ID undefined
              leadMobileDev2017

              Hello,

               

              how is it about Android? Are those certificates also generated by Adobe first? And if i make a Built, do i need an equivialent certificate from the Play Store too to get Push Notifications via FCM?

               

              Thanks in advance,

               

              Regards