触发访问提示并向用户显示

3

一些背景:

我用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.

我的应用只上传高分数到我的服务器。但如果苹果规定用户需要知道这一点,我会让它更加清晰明了。

实际任务:

由于我是用Java制作此应用,因此我对Objective-C编程一无所知。但我知道iOS有一些安全对话框,提示用户是否同意在应用中使用以下功能或数据。

我想调用此类对话框(并显示自己的消息)。

enter image description here

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

有人知道如何打开它吗?

1个回答

0
你可以尝试我的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();

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接