How to get device token of device in Unity 5?

1.6k views Asked by At

I am tring to get device token and I dont want to use Update function.

Right now I am using following function:

if (!tokenSent) {
    token =UnityEngine.iOS.NotificationServices.deviceToken;
    if (token != null) {
        // send token to a provider
        print ("My device Token");
        hexToken= "%" + System.BitConverter.ToString(token).Replace('-', '%');
        tokenSent = true;
    }
}
0

There are 0 answers