I'm trying to retriece the push notification token from Android and iOS (iPhone) devices in order to register to a third-party push notification platform. I checked the documentation provided by Adobe and it only states that I need to call cq.mobile.application.pushNotificationToken that this value would be already there. But when I use this, for Android I always get undefined (both emulator and real device) and for iOS it comes as null (only one device that I tested came with a base64 encoded value).
Are there extra configurations/plugins that I should enable for it to work?
Thanks for the response. Yes, I have that enabled and actually contacted Adobe directly. Turns out there might be a bug for Android only. Even with a Google Cloud Messaging (GCM) account setup, the phone receives the push notification when sent through the GCM console but the token is not being retrieved through cq.mobile.application.pushNotificationToken
As pointers for future readers: * Make sure you have "Enable Extensibility Features" on the articles that you need cordova working. Might be a good idea to set this enabled as default on project level (Edit Project, Content tab)
* Make sure to enable push notifications on Apple provision configuration
* Make sure to enable push notification on Android app generation, create a GCM project, download google-services.json and upload to AEM Mobile
* Make sure to allow push notifications when prompted on the app
As for the bug retrieving push notification token on Android, I'll update this question when I have more info.