1

I am trying to get Push Notifications to work in Unity3D on iOS for days now. I have double and tripple checked that the setup is correct: Provisioning Profile, Capabilities, everything is correct.

Deployment target is 9.1.

I have setup a test project with the exact same setup to test the PN with the device and it works everytime.

This is the only code I added to the test project (same as in the Unity-project):

UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound) categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];

I am guessing, something in the project setup or initialization code from the Unity side must mess up the PN registration.

Does anybody have ideas where to look for suspects??

Senad
  • 166
  • 1
  • 14
  • see this for example https://stackoverflow.com/questions/39382852/didreceiveremotenotification-not-called-ios-10/39383027#39383027 – Anbu.Karthik Jul 14 '17 at 09:11
  • I can't even get to the stage described in that question. My app failes to register and receive a device token. So it is one step earlier that it fails. – Senad Jul 14 '17 at 09:40

1 Answers1

0

Verify in the Entitlements.plist, aps-environment is set to your required value. If you are using production then the value should be production and if in sandox set to development. Hope this be helpful to you.

Abhilasha
  • 76
  • 1
  • 5
  • The entitlements are set to development and I am running in debug mode. Everything else (Provisioning profile, capabilities) is set up correctly. To make sure I made an identical (native swift) project with the same setup and only the PN code. That one works fine. However, I am unable to figure out, what the problem in the Unity3D project is. – Senad Jul 15 '17 at 09:41
  • The next thing I should try is to upgrade to the current Unity version. I just don't think it will help, as it should absolutely work with this version, too. – Senad Jul 15 '17 at 09:43