我在 Unity 游戏中实现了 Google Play 游戏服务。我已经构建并部署到 iOS,但我在第一次运行时收到推送通知的权限请求,iTunes connect 说我的应用程序请求推送通知访问。
我不需要推送通知,也没有故意实现它们,也没有在游戏中实现多人游戏。所以我假设这是 GPGS 中的自动操作?我可以禁用它吗?
谢谢!
最佳答案
我现在通过在文件 GPGSAppController.mm 中注释掉以下几行来解决这个问题,我相信它会注册应用程序以获取通知。
/*
// iOS 8 Notifications
if ([application
respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) {
[application registerUserNotificationSettings:
[UIUserNotificationSettings
settingsForTypes:(UIUserNotificationTypeSound |
UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge)
categories:nil]];
[application registerForRemoteNotifications];
} else {
// iOS < 8 Notifications
[application
registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeAlert |
UIRemoteNotificationTypeSound)];
}
*/
//gpg::TryHandleNotificationFromLaunchOptions(launchOptions);
//gpg::RegisterDeviceToken(deviceToken, GPGPushNotificationEnvironmentProduction);
在测试了所有我需要的 GPGS 功能后,我仍然可以使用,但我没有收到推送通知权限弹出窗口。
关于c# - 如何在 iOS 上的 Google Play 游戏服务中禁用推送通知权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37816745/