UIUserNotificationType myType = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
UIUserNotificationSettings *mySetting = [UIUserNotificationSettings settingsForTypes:myType categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:mySetting];
[UIApplication sharedApplication].applicationIconBadgeNumber =9999;