【问题标题】:Invoking access prompt and show it to the user调用访问提示并将其显示给用户
【发布时间】:2015-11-30 14:44:01
【问题描述】:

一点背景:

我在 Libgdx 中开发了一款游戏并将其上传到 iTunes 应用商店。我的应用因以下原因被拒绝:(这不是问题,但我想向您介绍一下我正在努力实现的目标)

> 17.1 Details

Additionally, we noticed that your app does not obtain user consent before collecting the user's personal data.

Specifically, users scores are posted to a high score feature. Please see the attached screenshot(s) for additional information.

Next Steps

To collect personal data with your app, you must make it clear to the user that their personal data will be uploaded to your server and you must obtain the user's consent before the data is uploaded.

- Starting with iOS 6, there are keys for specifying the reason the app will access the user's protected data. When the access prompt is displayed, the purpose specified in these keys is displayed in that dialog box. If your application will be transmitting protected user data, the usage string in your access request should clearly inform the user that their data will be uploaded to your server if they consent.

我的应用只将高分上传到我的服务器。但是,如果 Apple 声明用户应该知道这一点,我会说清楚的。

实际任务:

自从我用 Java 制作了这个应用程序以来,我对 Objective-C 编程一无所知。但我知道 iOS 有一些安全对话框,会提示用户是否可以在应用程序中使用以下功能或数据。

我想调用这种对话框(带有我自己的消息)

我也知道它应该在我的 info.plist 文件中定义,但我不知道如何在运行时访问它并在我的游戏中显示它。

有人知道如何打开它吗?

【问题讨论】:

    标签: ios objective-c libgdx


    【解决方案1】:

    你可以试试我的对话框窗口的 libgdx 扩展:https://github.com/TomGrill/gdx-dialogs

    或:

    您需要与平台规范代码接口:https://github.com/libgdx/libgdx/wiki/Interfacing-with-platform-specific-code

    在你的 iOS 界面实现中使用 UIAlertView 类来打开一个 AlertView:

    代码示例:

    UIAlertViewDelegateAdapter delegate = new UIAlertViewDelegateAdapter() {
    
        @Override
        public void didDismiss(UIAlertView alertView, long buttonIndex) {
            //handle button click based on buttonIndex
        }
    
        @Override
        public void clicked(UIAlertView alertView, long buttonIndex) {
    
        }
    
        @Override
        public void cancel(UIAlertView alertView) {
    
        }
    
        @Override
        public void willPresent(UIAlertView alertView) {
    
        }
    
        @Override
        public void didPresent(UIAlertView alertView) {
    
        }
    
        @Override
        public void willDismiss(UIAlertView alertView, long buttonIndex) {
    
        }
    
        @Override
        public boolean shouldEnableFirstOtherButton(UIAlertView alertView) {
            return false;
        }
    
    };
    
    String[] otherButtons = new String[1];
    otherButtons[0] = "No";
    String firstButton = "Yes";
    
    
    UIAlertView alertView = new UIAlertView("Title", "message", delegate, firstButton, otherButtons);
    
    alertView.show();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-19
      • 2013-08-10
      • 2017-05-06
      • 1970-01-01
      • 2015-04-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多