Background:

Just one iteration was developed and the product requirements and design were interactively implemented. However, it was rejected in the final review. There are all sorts of weird reasons why the review was rejected. Google should have an answer, but it didn’t. What to do?

Reasons for rejection:

Guideline 2.1 – Information Needed

We’re looking forward to completing our review, but we need more information to continue. Your app uses the AppTrackingTransparency framework, But we are unable to tolocate the App Tracking permission request when reviewed on iOS 15.0.

See this on iOS 15.0, you know what Apple is going to do, iOS14 is fine.

In Google…

Searched and found the official document…

Official explanation:

Call this APIrequestTrackingAuthorizationOnly if the App is active in the foreground.

Solutions:

Analysis:

For this kind of authorization request, is normally written in the AppDelegate didFinishLaunchingWithOptions, but clearly not accord with the requirement of the official, the App has not been to Active status.

Solution:

AppDelegate:

func applicationDidBecomeActive(_ application: UIApplication) {# if available (iOS 14.0. *) {ATTrackingManager. RequestTrackingAuthorization {(status: ATTrackingManager.AuthorizationStatus) in // ... }}}Copy the code

In addition, since SceneDelegate was also used in the project, AppDelegate was not implemented after iOS 13, so it was changed to make permission request in the sceneDidBecomeActive method of SceneDelegate. It also adds a 1 second delay to avoid conflicts with other permissions pop-ups.

func sceneDidBecomeActive(_ scene: UIScene) { DispatchQueue.global().asyncAfter(deadline: .now() + 1) { ATTrackingManager.requestTrackingAuthorization { (status: ATTrackingManager.AuthorizationStatus) in // ... }}}Copy the code

Conclusion:

It did take some time to fix the problem because iOS 15 was so new, Google data was so sparse, and one of the guys on StackOverflow only noticed the problem and no one responded. I made a note of the holes I stepped in. I hope it gives others a way out.

If there is a better solution, welcome to put forward, common progress!