ios - SOLVED: Testing if push notification is turned on -
Note: This was apparently due to some type of corruption in settings, the code appeared It was exactly the same with all ... After the conversation in this thread: I said this boilerplate code on my app: I also said the application: didRegisterUserNotificationSettings handler, which says a line of code, Reading that thread, it is suggested that it is all that is necessary, and this Did I miss a step, or just understand how to understand it?
if ([[UIApplication sharedApplication] RespondsToSelector: @ selector (registerUserNotificationSettings :)) {[UIApplication sharedApplication] registerUserNotificationSettings: [UIUserNotificationSettings settingsForTypes: UIRemoteNotificationTypeBadge section: zero]]; } And {[UIApplication shared applicant] registerfororemote notification type: UIRemoteNotificationTypeAlert]; } If ([[inLaunchOptions allKeys] containsObject: UIApplicationLaunchOptionsRemoteNotificationKey]) [[appTracking registerPush: [inLaunchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey]]; } [application registerForRemoteNotifications] . When the app starts, this code is . will cause the application that: didRegisterForRemoteNotificationsWithDeviceToken is called. But it's definitely not in my app.
Try this:
if ([answers app [ Tilak: @selector (registerUserNotificationSettings :)) {UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound); UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes: userNotificationTypes categories: nil]; [Application register user notification settings: settings]; [Application registerfororemote notification]; } Other {{Application RegisterForremote Notification Type: (URImot Notification Type) UITerm Notification Type Alert | Type the URImote notification type]]; }
Comments
Post a Comment