- (void)registerUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
After calling this method, the app calls theapplication:didRegisterUserNotificationSettings: method of its app delegate to report the results. You can use that method to determine if your request was granted or denied by the user.
Available in iOS 8.0 and later.
- (UIUserNotificationSettings*)currentUserNotificationSettings
If you configure local or push notifications with unavailable notification types, the system does not display the corresponding alerts to the user. The system does still deliver the local and push notifications to your app.
Available in iOS 8.0 and later.
- (void)registerForRemoteNotifications
Call this method to initiate the registration process with Apple Push Service. If registration succeeds, the app calls your app delegate object’sapplication:didRegisterForRemoteNotificationsWithDeviceToken:method and passes it a device token. You should pass this token along to the server you use to generate push notifications for the device. If registration fails, the app calls its app delegate’sapplication:didFailToRegisterForRemoteNotificationsWithError:method instead.
Available in iOS 8.0 and later.
- (BOOL)isRegisteredForRemoteNotifications
This method reflects only the successful completion of the remote registration process that begins when you call theregisterForRemoteNotifications method. This method does not reflect whether push notifications are actually available due to connectivity issues. The value returned by this method takes into account the user’s preferences for receiving push notifications.
Available in iOS 8.0 and later.
NSString *const UIApplicationOpenSettingsURLString;
UIApplicationOpenSettingsURLString
Used to create a URL that you can pass to the openURL: method. When you open the URL built from this string, the system launches the Settings app and displays the app’s custom settings, if it has any.
Available in iOS 8.0 and later.
NSString *const UIApplicationKeyboardExtensionPointIdentifier;
The identifier for custom keyboards. To reject the use of custom keyboards in your app, specify this constant in your implementation of the application:shouldAllowExtensionPointIdentifier: delegate method.
Available in iOS 8.0 and later.
本文深入探讨了iOS应用中本地与远程通知的注册流程,包括如何配置通知设置、使用currentUserNotificationSettings方法检查可用性,以及如何通过registerForRemoteNotifications方法启动远程注册过程并处理成功或失败情况。
1264

被折叠的 条评论
为什么被折叠?



