天天看點

cocos creator 釋出IOS版本(二) AppTrackingTransparencyGuideline 5.1.1 - Legal - Privacy - Data Collection and Storage

稽核未通過原因:

Guideline 5.1.2 - Legal - Privacy - Data Use and Sharing

The app privacy information you provided in App Store Connect indicates you collect data in order to track the user, including Product Interaction. However, you do not use App Tracking Transparency to request the user's permission before tracking their activity.

參考連結:

https://blog.csdn.net/jiadabin/article/details/111598826

https://blog.csdn.net/qq1031286222/article/details/109822409

蘋果官網明确指出:

確定您的應用已準備好用于iOS 14.5,iPadOS 14.5和tvOS 14.5。在即将釋出的公共發行版中,所有應用都必須使用AppTrackingTransparency架構來請求使用者允許其跟蹤或通路其裝置的廣告辨別符的權限。除非您獲得使用者允許啟用跟蹤的權限,否則裝置的廣告辨別符值将全為零,并且您可能無法跟蹤它們。

意思是14.5以後的版本,想要允許其跟蹤或通路其裝置的廣告辨別符,就得使用他們的架構AppTrackingTransparency,是以基本接入廣告就得接入架構。

具體步驟:

1、工程 

Info.plist

檔案新增使用者授權提示文案,用 

Source Code

的方式打開

Info.plist

檔案,添加如下代碼,string值可根據實際需要自行設定:

cocos creator 釋出IOS版本(二) AppTrackingTransparencyGuideline 5.1.1 - Legal - Privacy - Data Collection and Storage

添加 NSUserTrackingUsageDescription 字段和自定義文案描述

cocos creator 釋出IOS版本(二) AppTrackingTransparencyGuideline 5.1.1 - Legal - Privacy - Data Collection and Storage

 <key>NSUserTrackingUsageDescription</key>

<string>該辨別符将用于向您投放個性化廣告</string>

或者

 <key>NSUserTrackingUsageDescription</key>

<string>Your data will be used to provide you better personalized ads</string> 

權限描述的模闆:https://airtable.com/shrgVLgfz6tdbv3Fc/tblZVr9BgJ2Cb0ihB

注意:對應的<string> 的内容一定得寫,不然會打回報出

Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage

 2、在添加lib庫,在 General中找到Frameworks...中點選加号,找到AppTracking...framework,添加上

cocos creator 釋出IOS版本(二) AppTrackingTransparencyGuideline 5.1.1 - Legal - Privacy - Data Collection and Storage

 3、添加調取權限視窗代碼

commend+N,調取生成class 視窗,選擇cocoa Touch Class ,在ios檔案夾中生成

cocos creator 釋出IOS版本(二) AppTrackingTransparencyGuideline 5.1.1 - Legal - Privacy - Data Collection and Storage
cocos creator 釋出IOS版本(二) AppTrackingTransparencyGuideline 5.1.1 - Legal - Privacy - Data Collection and Storage

GDATTrackingIdfa.h

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface GDATTrackingIdfa : NSObject
+ (instancetype)sharedSingleton;
 
+ (void)requestIDFA;
 
- (void) callCocos;
@end

NS_ASSUME_NONNULL_END
           

 GDATTrackingIdfa.m

#import "GDATTrackingIdfa.h"
#import <AdSupport/AdSupport.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>

@implementation GDATTrackingIdfa

+ (instancetype)sharedSingleton {
   static GDATTrackingIdfa *_sharedSingleton = nil;
   static dispatch_once_t onceToken;
   dispatch_once(&onceToken, ^{
       //不能再使用alloc方法
       //因為已經重寫了allocWithZone方法,是以這裡要調用父類的配置設定空間的方法
       _sharedSingleton = [[super allocWithZone:NULL] init];
       [_sharedSingleton initDelegate];
       [_sharedSingleton checkTransaction];
   });
   return _sharedSingleton;
}

+ (void)requestIDFA {
    if (@available(iOS 14.0, *)) {
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {

        }];
        NSLog(@"------ requestIDFA---14.0-------");
    }else
    {
        NSLog(@"------調用 requestIDFA----14.0yixia----------");
    }
}

- (void) callCocos {
//   std::string jsCallStr;
//   std::string testString1 =[@"testString1" UTF8String];
//   std::string testString2 = [@"testString2" UTF8String];
//   jsCallStr = cocos2d::StringUtils::format("receiveNative(\"%s\",\"%s\");", testString1.c_str(), testString2.c_str());
//   se::Value *ret = new se::Value();
//   se::ScriptEngine::getInstance()->evalString(jsCallStr.c_str() , -1 , ret);
}

@end
           

然後再cocos creator 中調用 requestIDFA 接口,彈出權限視窗(注意callStaticMethod會報錯,不用管,提示需要三個參數,但實際ios使用就是兩個參數 ,不需要methodSignature參數)

if (cc.sys.os === cc.sys.OS_IOS) 
        {
            console.log("cocos---requestIDFA---");
            jsb.reflection.callStaticMethod("GDATTrackingIdfa","requestIDFA");
            DataMgr.inst.ShowATTracking=true;
            
        }
           

選用ios14.5及以上系統的測試機,或者使用内部的ipone12進行測試,14.5以下的版本是預設開啟權限的不會調出視窗

cocos creator 釋出IOS版本(二) AppTrackingTransparencyGuideline 5.1.1 - Legal - Privacy - Data Collection and Storage

 最後在送出稽核之前貼在備注裡面,找到的大神寫的一個模闆,讓ios對你的應用稽核更友善

-Guideline x.x.x - Legal - Privacy - Data Collection and Storage
關于此問題,我們根據您的提示,對項目進行了徹底的檢查。
發現确實會詢問使用者是否同意通路本地網絡資訊。詢問使用者的原因是為了實作xxxxxxxxxx功能。
這是一個使用者十分需要的xxxx功能,跟使用者業務息息相關。
如果沒有xxxxx,那麼使用者就xxxxxxxxx,造成損失,這是我們開發者和使用者都不願意看到的。
對此,我們做了充分說明,在看到說明後使用者再做出明智的決定。更改後的說明原文為:此App将可xxxxxxxxx.
除此之外,我們并無做出其他不尊重使用者的行為。

以上是我這邊的處理結果,如果您還有疑問,随時都可以聯系我(+86159xxxx8824)。

誠摯的問候!
           

繼續閱讀