更新时间:2022-06-10 22:15:53
您必须调用 [[UIApplication sharedApplication] registerForRemoteNotifications];
才能正确注册远程通知.
You must call [[UIApplication sharedApplication] registerForRemoteNotifications];
to properly register for remote notifications.
为后台使用配置远程通知
您是否已将应用的后台模式配置为接受远程通知?您可以点击:项目名称 -> 功能 -> 背景模式
Have you configured your app's background modes to accept remote notifications? You can do this by clicking: Project Name -> Capabilities -> Background Modes
打开此功能,然后勾选远程通知旁边的框,如下面的屏幕截图所示.
Turn this on and then tick the box beside Remote Notifications as seen in the screenshot below.