question

andre-vgm avatar image
andre-vgm asked

Can't get Android Push to work [Unity SDK],Cannot get Android Push to work [Unity SDK]

Hey I have spent couple of hours to get the Android Push to work but I can't :(

I have followed several guides but the "_RegistrationReadyCallback" doesn't get called...

  • I have the latest Unity SDK imported from the Asset Store and unpacked the Android Plugin...
  • I've set up a Google Project and copied the Sender ID to be used for initializing the Android plugin
  • I adapted my AndroidManifest file (like this one)
  • but the _RegistrationReadyCallback won't get fired...

Have I missed something? Am I right that I do not have to be logged in as PlayFab client to get a token?

Hope you can help ;)

    ,

    Hey, I have spent the last couple of hoursto get Android Push to work, but I can't :(

    I have followed all steps of the documentation (https://api.playfab.com/docs/push-for-android) and the guide on GitHub. I do not get the "_RegistrationReadyCallback" event called. That is really strange because I have unpacked the Android Push Package for Unity and the latest SDK for Unity from the Asset Store... I hope you can help ;)

    Push Notifications
    1 comment
    10 |1200

    Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

    andre-vgm avatar image andre-vgm commented ·

    Sorry for the mess xD I had to write my question twice... but now there are duplicates in my post :P

    0 Likes 0 ·

    1 Answer

    ·
    brendan avatar image
    brendan answered

    Can you try giving the Push Notification Debugger a try, and see what the results are of the "test push" option"? It provides an example of getting the token as well as testing whether the Admin setup part of the process has been completed successfully.

    https://github.com/PlayFab/PlayFab-Samples/tree/master/TestingTools/PushNotifications

    3 comments
    10 |1200

    Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

    andre-vgm avatar image andre-vgm commented ·

    I've given it a try and I am able to register for push :P ...do I have to be logged in as a client before I am able to retrieve a token? Currently I request a token before logged in, save the token and then push it to PlayFab after my login process. But in my projects the registrationreadycallback never gets called

    0 Likes 0 ·
    andre-vgm avatar image andre-vgm commented ·

    Ok I figured it out: I replaced "void OnGCMReady(bool status)" with "public static void OnGCMReady(bool status)" and it worked now! The devil lies in the detail...

    Thank you for your help!

    0 Likes 0 ·
    brendan avatar image brendan andre-vgm commented ·

    Excellent - glad to hear you're no longer blocked!

    1 Like 1 ·

    Write an Answer

    Hint: Notify or tag a user in this post by typing @username.

    Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.