如何在ios 8中注册和使用多个交互式推送类别

如何在ios 8中注册和使用多个交互式推送类别,ios,ios8,push-notification,apple-push-notifications,interactive,Ios,Ios8,Push Notification,Apple Push Notifications,Interactive,您好,我成功创建了一个交互式推送集,但当我尝试注册多个推送集时,它只注册最后的设置,而以前注册的设置只是被覆盖 我的问题是如何创建具有不同标识符的多个交互式推送,以便在需要时激发其中任何一个标识符。只需在NSSet上使用setWithObjects方法,即可将两个类别包含在一个set对象中: NSSet *set = [NSSet setWithObjects:yesNoButtonBackground, acceptDeclineBackground]; 然后只需调用registerUser

您好,我成功创建了一个交互式推送集,但当我尝试注册多个推送集时,它只注册最后的设置,而以前注册的设置只是被覆盖


我的问题是如何创建具有不同标识符的多个交互式推送,以便在需要时激发其中任何一个标识符。

只需在NSSet上使用setWithObjects方法,即可将两个类别包含在一个set对象中:

NSSet *set = [NSSet setWithObjects:yesNoButtonBackground, acceptDeclineBackground];
然后只需调用registerUserNotificationSettings一次:

[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:types
                                                                                      categories:set]];