Not getting the device token (using Unity plugin for iOS)



  • Avatar
    Max Konev

    I cannot reproduce the second issue, but let me explain the first one.
    Push token registration is asynchronous procedure. Therefore if you query the push token straightaway after the registration function call - you will receive empty string as there is no push token obtained yet.
    Look at the callback function: void onRegisteredForPushNotifications(string token)
    It will be called when push token has been received. After that getPushToken() method will start returning value. On subsequent launches when push token is obtained already, the function will return the value straightaway.

    If you always receive empty token - please share the logs from the device console.

  • Avatar

    Thanks shader,

    You are right, I put a count delay print at the Update method to give time for the registration to complete as Unity doesn't give have callback event - At this point in time PushWoosh token is still empty?!

    Following you good advise I removed the print from the PushWoosh 'Start' and put it within the method 'onRegisteredForPushNotifications' - this was never called and no string was returned as the token.

    Weirdly - I am getting notify from PushWoosh on Sandbox/Production test devices (different tokens), but I never got the token from the PushWoosh code, only from Unity method

Please sign in to leave a comment.