Push notifications is not work

Hello.


I am developing an application that includes push notifications, I can receive notifications when I connect an iPhone to a Mac via USB and launch an application from XCode (Scheme Run is Relase), but when I install it as an application for TestFlight's internal tester , I can not receive push notifications.


Certificate and XCode settings are as follows.



> Apple Push Service Certificate and APNs Development iOS Certificate

I made it on iOS Certificates on the Apple Developer site and downloaded each.

Identifiers> The target ID of App IDs is Push Notifications Enabled in both Development and Distribution.

Also in the key chain access login, Apple Push Service and Apple Development iOS Push Service are registered with the target AppID.


· TARGETS> Capabilities> Push Notifications

ON. Both steps are checked.

I added two entitlements files to the project.

Development.entitilements for Development

→ <key> aps-enviroment </ key> <string> development </ string>

Production.entitilements for Production

→ <key> aps-enviroment </ key> <string> production </ string>


· TARGETS> Build Settings> Signing> Code Signing Entitlements

> Debug - [project name] /development.entitilements

> Release - [project name] /production.entitilements


· TARGETS> Build Settings> Signing> Code Signing Identity

> Debug - Apple Development iOS Push Services: ********

> Debug - Any iOS SDK - iOS Developer

> Release - Apple Push Services: ********

> Release - Any iOS SDK - iOS Developer

So was an error to set the "iOS Distribution" to - "Release Any iOS SDK", Will, but was changed to "iOS Developer" may be this in accordance with the message?


· The server that sends a notification, Apple Push Service certificate that you downloaded in the above-mentioned and (.cer), it has signed with the .p12 file exported from Keychain Access.



Please let me know if you need additional information.


Thank you.

Post not yet marked as solved Up vote post of naoki-shift Down vote post of naoki-shift
9.8k views

Replies

Hello.

I solved the problem.


There was no problem with the above setting.

The server configuration was wrong.

· Development APNs Host: gateway.sandbox.push.apple.com

· Production APNs Host: gateway.push.apple.com


Thank you very much.

Hi ,


The same issue happened for me. When building app with developer profile the push notification coming as per flow. But if i build it with production profile no notification coming as well. I've used Firebase for notification.

Hi,


What did you mean by "The server configuration".


I am getting the same issue where I run my app via USB on my device. Publish a notification via the Amazon SNS web interface.


Once deploying through TestFlight and performing a publish like above via Amazon, I receive no notification.

- Scheme is Release.

- Publishing to sandbox endpoint (possibly the reason) ?

Yes, when building for TestFlight - your app is signed to receive push from production APNs (Host: gateway.push.apple.com).