gpt4 book ai didi

iOS 设备 token

转载 作者:行者123 更新时间:2023-12-01 18:54:30 31 4
gpt4 key购买 nike

如果我在我的设备上接受推送通知,并且不保存设备 token ,那么我如何在自定义 View 中查看设备 token 或恢复警报 View ?

我删除了应用程序并重新安装,但看不到设备 token 警报 View ,并撤销权限,但看不到警报 View

if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
// iOS 8 Notifications

UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
}
else
{
// iOS < 8

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}

最佳答案

根据您的问题,我不确定您的问题是什么我认为您被要求在第二次删除或重新安装应用程序后没有收到推送通知警报,对吗?

作者 Apple Document

启用推送的应用第一次注册推送通知时,iOS 会询问用户是否希望接收该应用的通知。一旦用户对此警报做出响应,除非设备已恢复或应用程序已卸载至少一天,否则它不会再次显示。

如果你想模拟你的应用程序的首次运行,你可以让应用程序卸载一天。您可以按照以下步骤实现后者,而无需实际等待一天:

  • 从设备中删除您的应用程序。
  • 完全关闭设备并重新打开。
  • 前往“设置”>“通用”>“日期和时间”,将日期提前一天或更长时间。
  • 再次完全关闭设备,然后重新打开。

  • 更多内容请阅读苹果 push notification Review Guidelines .

    关于iOS 设备 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28623836/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com