https://metaplay.io logo
Debugging Push notifications from MP when they wor...
# questions-and-feedback
a
Hi, I wonder how to go about debugging push notifications from Metaplay? I have them working from the Firebase Console on the web to the app and to my phone, also when the app is not on. However no luck so far from sending them from the Dashboard, from a test campaign, to the same user to where it works from Firebase console. The creds for the FB auth are in the conf and Firebase is enabled there. Dashboard says that it processes the 1 player but then says that 0 players notified. There are no errors in the server log, I just see the db scan job execution there. Firebase doesn't seem to receive anything.
searching "firebase" in the log shows that at least ok PushNotification: PushNotificationOptions { Enabled = True FirebaseCredentialsPath = aws-sm://(..)/firebase_credentials UseLegacyApi = False }
maybe i could add more debugging about where it connects and what it does when trying to send a message etc
j
One thing ot check is whether PlayerPushNotifications in PlayerModel has valid entries
a
ah cool thanks i didn't know that existed
hm at least on the phone the notifications collection is empty and it seems also the token is not there i see the token in the log though and push messages work with that token from the firebase console PlayerModel.PushNotifications.GetValueTupleItemObjectsFlattened().Count() => 0 PlayerModel.PushNotifications.GetFirebaseMessagingTokens().FirstOrDefault(); => empty string on my debug canvas
ah maybe i need to add code to put the token for metaplay i receive it but don't do anything with it .. FirebaseApplication is my script FCM: Retrieve registration token [FirebaseApplication OnTokenReceived] Received Registration Token: c2iI2_(...)
i did see this in the docs: > If your game doesn’t use the SDK-provided MetaplayClient, you can register the Token by adding a handler for the Firebase.Messaging.FirebaseMessaging.TokenReceived event to receive the Token from Firebase, and invoking the PlayerAddFirebaseMessagingToken but i thought i was using the SDK-provided MetaplayClient
and i guess i am
MetaplayClient.Initialize(new MetaplayClientOptions
oh cool i disabled my own event handler and now i see > PlayerAddFirebaseMessagingToken
works!
j
Glad you got it working!