Push notifications do not work in iOS7, but they work in iOS6

I'm having problems with push notifications in iOS7.

I developed an application for iOS6 and push notifications work very well. But, when I put this application on the iOS7 device, it does not start.

But something is very strange. If I use the development key, my iOS7 device can receive push, but with the Production key it cannot.

I can get my tokenide for push, but it can't get anything.

Any idea?

This is my code:

Appdelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // PUSH-CODE
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
    ....
}

// PUSH-CODE
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{    
    NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet:      [NSCharacterSet characterSetWithCharactersInString:@"<>"]];
    token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSLog(@"Token: %@", token);

    [[NSUserDefaults standardUserDefaults] setObject:token forKey:@"deviceToken"];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
    NSLog(@"Failed to get token, error: %@", error);
}
+4
source share
2 answers

Google, " ios7 ", , . , Apple . iTunes . factory reset, .

  • iOSX.0 - " "
  • iOSX.1 - " , "
  • iOSX.2 stable, , , 3 X.0:)
+5

, . ,

0

All Articles