2015-09-04 22 views
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. 

我的應用程序只能上傳高分到我的服務器。但是,如果蘋果聲明用戶應該知道這一點,我會說清楚的。

實際使命:

我不知道Objective-C編程任何事情,因爲我在Java中做這個程序。但我知道iOS有一些安全對話框,提示用戶是否可以在應用程序中使用以下功能或數據。

我想調用這種對話(我自己的信息)

enter image description here

我也知道它應該在我的Info.plist文件中定義,但我不知道如何訪問它在運行時會顯示在我的遊戲中。

有人有線索如何打開它?

回答

0

你可以試試我libgdx擴展對話窗口:https://github.com/TomGrill/gdx-dialogs

或:

您需要的平臺specifig代碼交互: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();