我创建了设置包以及三个用于警报、声音和徽章的开关。根据开关(开/关),我也得到 0 或 1。现在如何在调用此方法时仅启用选定的通知类型
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(here I want to set types from settings)];
如何设置类型?
我创建了设置包以及三个用于警报、声音和徽章的开关。根据开关(开/关),我也得到 0 或 1。现在如何在调用此方法时仅启用选定的通知类型
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(here I want to set types from settings)];
如何设置类型?
您可以只传递一个(或多个)UIRemoteNotificationType,例如
[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
我建议您在此处启用所有类型。这将在设置应用程序的推送通知设置下为应用程序创建一个新设置,这是用户配置推送通知的标准位置。
我反对在您的应用程序设置包中拥有自己的配置。