IPhone SDK Push Notification

I have set up push notifications in the Apple Developer Panel and the code has been added to my application.

It works fine on the phone using the development profile, but if I use the distribution profile (ad-hoc) so that I can pass it to several users for testing, it gives an error and a failure, the log gives the following error

code:

Thu Jun 25 22:22:35 unknown SpringBoard[729] <Warning>: *** Assertion failure in -[SBRemoteNotificationServer registerApplication:forEnvironment:withTypes:], /SourceCache/SpringBoard/SpringBoard-919.5/SBRemoteNotificationServer.m:633
Thu Jun 25 22:22:35 unknown SpringBoard[729] <Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no connection found for environment production'

I am using the following code in an application

code:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];

What I don't understand is why it works fine using the development profile, but with ad-hoc it crashes.

Does anyone know what might cause this? I tried to change a lot of things to try to find the problem, but did not find anything.

+3
source share
6

. [[UIApplication sharedApplication] registerForRemoteNotificationTypes:...].

, APN, APN , .

Xcode, :

iPhone " "

, ..

+2

, App Store, push-. Le Monde.fr. , .

+2

, ..

+1

, , "" Push Notifications, .

0

, - " ".

0

Here is my solution and it is related to how adhoc profiles work. Adhesive profiles cannot be installed through xCode. You need to create and archive the application and install it using iTunes or the organizer. This fixed it for me.

0
source

Source: https://habr.com/ru/post/1711331/


All Articles