Warm tip: This article is reproduced from serverfault.com, please click

Apple push notifications and debugging in Xamarin Studio

发布于 2013-12-20 13:11:25

I'm getting the exception...

Registration failure: no valid 'aps-environment' entitlement string found for application

...in the FailedToRegisterForRemoteNotifications callback function when I try and register with APNS in my Xamarin iOS app.

Oddly I only get this exception when I compile in Debug mode not Release mode, which means it can't be one of the many, many ways this process might normally fail.

Am I missing some subtlety of how Debug builds work in monotouch?

Questioner
Rupert Rawnsley
Viewed
0
Rupert Rawnsley 2013-12-20 21:11:25

While refining the question I found an answer: incremental build is incompatible with APNS.

Incremental build is on by default for debug mode, and there must be something unusual about the app files it creates that prevents the provisioning certificate (which contains the APNS entitlement) being picked up by the device. I suspect it is the same thing that stops apps built in this way launching standalone.