菜鸟教程小白 发表于 2022-12-11 16:43:58

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


                                            <p><p>我在 Unity 游戏中实现了 Google Play 游戏服务。我已经在 iOS 上进行了构建和部署工作,但我在首次运行时收到了推送通知的权限请求,并且 iTunes 连接说我的应用程序请求推送通知访问权限。 </p>

<p>我不需要推送通知,也没有故意实现它们,也没有在游戏中实现多人游戏。所以我假设这是 GPGS 中的自动操作?我可以禁用它吗?</p>

<p>谢谢!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我现在通过注释掉文件 GPGSAppController.mm 中的以下几行来解决这个问题,我相信它可以注册应用程序以获取通知。</p>

<pre><code>/*
// iOS 8 Notifications
if ([application
       respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) {
    [application registerUserNotificationSettings:
   [UIUserNotificationSettings
      settingsForTypes:(UIUserNotificationTypeSound |
                        UIUserNotificationTypeAlert |
                        UIUserNotificationTypeBadge)
      categories:nil]];
    ;
} else {
    // iOS &lt; 8 Notifications
    [application
   registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                       UIRemoteNotificationTypeAlert |
                                       UIRemoteNotificationTypeSound)];
}
*/
//gpg::TryHandleNotificationFromLaunchOptions(launchOptions);
//gpg::RegisterDeviceToken(deviceToken, GPGPushNotificationEnvironmentProduction);
</code></pre>

<p>在测试完所有需要的 GPGS 功能后,我仍然可以使用,但没有弹出推送通知权限。</p></p>
                                   
                                                <p style="font-size: 20px;">关于c# - 如何在 iOS 上禁用 Google Play 游戏服务中的推送通知权限?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/37816745/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/37816745/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: c# - 如何在 iOS 上禁用 Google Play 游戏服务中的推送通知权限?