Get the Push-Notification list on iOS8

前端 未结 1 1019
一个人的身影
一个人的身影 2020-12-13 22:27

Is it possible to get the text of all the received push notifications on iOS 8?

Has anyone found something on the documentation provided by Apple?

I know tha

相关标签:
1条回答
  • 2020-12-13 23:19

    Its very simple try this in Xcode6:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        //-- Set Notification
            if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
            {
                [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
                [[UIApplication sharedApplication] registerForRemoteNotifications];
            }
            else
            {
                [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
                 (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
            }
    
         //--- your custom code
         return YES;
    }
    
    0 讨论(0)
提交回复
热议问题