When first setting up Push Notifications, I started with Android.
I added the Google server API key to my title Settings section, created the project on the Firebase console, added an app for the google play id, and downloaded the google-services.json and added it to my Unity Assets folder.
I followed the instructions here for a client side c# script: https://firebase.google.com/docs/cloud-messaging/unity/client
I tested it, worked like a charm, no problems at all.
Next I wanted to set up ios... I created my .p12 certificate for the project / Mac Book I was using, then converted it to a .cen file using this: openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert.pem -nodes -clcerts
Right away the request for ios push notification request was returning an error in xcode telling me that my token I am passing in was too long, and couldn't go past a certain limit (I forget the exact error, but can bring it up if that will help).
So after doing some digging, I found this: https://api.playfab.com/docs/tutorials/landing-players/push-notification-basics/push-notifications-for-ios
It says to convert the byte array to a string... request.DeviceToken = System.BitConverter.ToString(token).Replace("-", "").ToLower();
Since I already had a string, but PlayFab wants it in a certain format, I attempted to first convert the token FCM gave me back to a byte array, then parse it the way PlayFab likes it:
pushToken = System.BitConverter.ToString(Encoding.ASCII.GetBytes(pushToken)).Replace("-", "").ToLower();
This seemed to have worked client side, I get the response that the end point was registered successfully, and when I look at my PlayFab dashboard, it shows an end point under my player. So I clicked to test sending the endpoint a push, and although it behaves as though the push was sent, I never received it on my client app.
I thought it was a glitch, so I try sending another push test, and this time it says I need to enter a number for 'Badge (number greater than zero)'. So I throw in some random int, like 1 or 2, etc.
This time the push fails, and it tells me the client unregistered the endpoint... even though I didn't touch the client app in any way, shape, or form.
At this point, I was advised by a friend not to use FCM, but just to follow the instructions here:
So I do, and I get the same results... the end point is registered, but when I try to sent a push test, the client never gets it, and the second attempt fails with the same error.
Then I get desperate, and think that I could just request pushes as an android, since I'm using a FCM token, PlayFab shouldn't care if the platform is ios or an apk, but this didn't work either.
So after double and triple checking all my work, I'm posting here to see if there is something I am missing, or if there is perhaps an issue on PlayFabs back end...
Android is still working like a charm.