Page 1 of 1

Getting Device Unique ID for Push Notifications - "Class Not Found"

Posted: Fri Jul 19, 2013 7:54 pm
by James Wilkinson

I am attempting to write an application that acquires and displays the Android device IDs for purposes of push notification.

According to the tutorial, I should be able to do this:

alert(PushNotification.getDeviceUniqueIdentifier());

Unfortunately, this never worked for me. After much trial and error, I was able to finally get the snippet shown below to work:

window.plugins.pushNotification.getDeviceUniqueIdentifier(function(id){ alert(id); });

Unfortunately, even this has stopped working! I get a “Class Not Found” error. Can anyone help? What is the proper technique for getting this identifier?

Thanks!!


Getting Device Unique ID for Push Notifications - "Class Not Found"

Posted: Fri Jul 19, 2013 7:57 pm
by Kateryna Grynko

Hi James,

To access deviceID on Device Ready event (Page Load and Page Show won't work) you can use the following JavaScript code:
codedevice.uuid/code
In Appery.io the following code is also available:
codePushNotification.getDeviceUniqueIdentifier();/code
This can be used on device only.


Getting Device Unique ID for Push Notifications - "Class Not Found"

Posted: Fri Jul 19, 2013 8:29 pm
by James Wilkinson

Thank you! Your last sentence turned out to be the key: I had to actually install an APK file on an Android device for this to work. Once I did that, all of these techniques for getting device ID began working.


Getting Device Unique ID for Push Notifications - "Class Not Found"

Posted: Tue Oct 20, 2015 5:19 pm
by Jean7787029

Hi,

Can you explain where the 'PushNotification.getDeviceUniqueIdentifier();' goes?

Or 'window.plugins.pushNotification.getDeviceUniqueIdentifier(function(id){ alert(id); }); '


Getting Device Unique ID for Push Notifications - "Class Not Found"

Posted: Wed Oct 21, 2015 4:12 pm
by Serhii Kulibaba

Hello Jean we have changed the mechanism for obtaining pushNotificationDeviceID. Please look at this documentation:

https://devcenter.appery.io/documenta...