c# - 如何在 iOS 上的 Google Play 游戏服务中禁用推送通知权限?

标签 c# ios iphone unity3d google-play-games

我在 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/

相关文章:

c# - C# using 语句可以不用花括号写吗?

C# Com 互操作 : Set Background Colour Of A Row

c# - 与 C# 中的 NULL 混淆

ios - 具有配置文件和基本游戏化功能的 iOS 应用程序的 Firebase 数据结构

iphone - 在 Interface Builder 中构建 UIView

iphone - 在 didSelectRowAtIndexPath 访问自定义标签属性

iphone - 添加外部库作为目标依赖项并链接到外部库

c# - JQuery 中的 JSON 格式问题

iOS TCP/IP over USB 与 Linux 端

objective-c - 我的 iPhone 应用程序可以与连接的计算机通信吗?