question

Alexis Bauchu avatar image
Alexis Bauchu asked

How to make Apple Push Notifications work in TestFlight builds,Push Notifications won't work in TestFlight builds

Hello,

I'd like to know if anyone has problems testing Apple Push Notifications with TestFlight builds.

I've followed "Push Notifications basics" and "Push Notifications for iOS" tutorials, and I can successfully send push notifications from the PlayFab dashboard to a specific user who has a direct XCode build.

So this means that certificates are ok (sandbox), user registration is ok (they send to PlayFab sandbox tokens, if I trust the player profile in PlayFab). As far as I know, this is the only difference: a device with a XCode build will receive push notifications, a TestFlight one will not...

Can anyone help me troubleshoot this please?

,

Hello,

I'd like to know if anyone has problems testing Apple Push Notifications with TestFlight builds.

I've followed "Push Notifications basics" and "Push Notifications for iOS" tutorials, and I can successfully send push notifications from the PlayFab dashboard to a specific users who has a direct XCode build.

So this means that certificates are ok (sandbox), user registration is ok (they send to PlayFab sandbox tokens, if I trust the player profile in PlayFab). The difference is a device with a XCode build will receive push notifications, a TestFlight one will not...

Can anyone help me troubleshoot this please?

Push Notifications
10 |1200

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

1 Answer

·
Hernando avatar image
Hernando answered

I'm not familiar with iOS development, but after I searched, I got some results that might help you.

When you install via Xcode directly such as you are testing a development build in house. The certificate came from the sandbox environment, you need to send the push notifications through the development URL and provider a development certificate generated (or an authentication token), and you can't send it to the production push service.

Similar to this, Anything installed via TestFlight or App Store needs to be sent through the production URL and provider a production certificate generated (or an authentication token). And if you do send a device certificate to the wrong environment, the push service will see that as an invalid certificate and discard the notification.

reference linking:

https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns

https://developer.apple.com/library/archive/technotes/tn2265/_index.html

Besides, this is not a Playfab-side issue hence you can get more help from Apple Developer Forums.

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.

Alexis Bauchu avatar image Alexis Bauchu commented ·

Thanks you very much. I changed the .pem pushed to PlayFab for a production one. This solved my issue with TestFlight builds. I mistakenly thought device tokens had a "sandbox" in their string, but this was part of the URL used to send the notifications (due to the sandbox .pem uploaded to PlayFab).


On a side note, I used Fastlane to produce and download the .pem file, but apparently it won't produce a file other than sandbox, even with a "--production" option. Bug? I don't know yet, but I had to do it the old way, on the Apple developer portal.

0 Likes 0 ·

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.