James Wilkinson
Posts: 0
Joined: Fri Jul 19, 2013 7:48 pm

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

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!!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

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.

James Wilkinson
Posts: 0
Joined: Fri Jul 19, 2013 7:48 pm

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

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.

Jean7787029
Posts: 0
Joined: Wed Sep 30, 2015 5:56 pm

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

Hi,

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

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

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

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

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

Return to “Issues”