Messaging Service with Rest API - How to get the Get Device Id and Token?

Greetings,
I’m trying to subscribe my device to receive/send push notifications using the REST API.

This is probably out of the scope of Backendless, but could anybody tell me how to get the Device ID and Token for a Device?

any help would be greatly appreciated,
Geo

Hi Geo,

Does your code run on a device? What operating system is it? Are you developing in native code?

Regards,
Mark

Greetings Mark,
Yes, the code runs on an Android Device (4.0.3).
I’m using MonoDroid.

I think I just found how to get the Device Id (untested just found it):

var _deviceID= Settings.Secure.GetString(ApplicationContext.ContentResolver, Settings.Secure.AndroidId);

No idea if it works, but I’ll try it, but if you could help with the token would be fantastic.

Thanks a lot,
Geo

A device ID is just a unique identifier which we will use to pinpoint the device. If you can get to the following value, it would do the job:
http://developer.android.com/reference/android/os/Build.html#SERIAL

Cheers,Mark

As for the Token for a device, you need to obtain it from GCM when you register your device with them (this is one of the reasons why using our API makes your life so much easier). I understand that with the single source approach it is not that useful, but if you can get the token, you can still use our REST API.