1. 原因
iOS15でATTrackingManagerプロンプト表示の実行条件が厳格化され、アプリの実行ステータスがUIApplicationStateActive
の時のみ実行されるようになったのが理由である。
Calls to the API only prompt when the application state is UIApplicationStateActive. The authorization prompt doesn’t display if another permission request is pending user confirmation. Concurrent requests aren’t preserved by iOS, and calls to the API through an app extension don’t prompt. Check the trackingAuthorizationStatus for a status of ATTrackingManager.AuthorizationStatus.notDetermined to determine if you need to make an additional call.
参考記事:
https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorization
AppDelegateのapplicationDidFinishLaunchingメソッドでプロンプト表示を実行している場合、アプリの実行ステータスがUIApplicationStateActiveではないので、iOS15ではプロンプト表示は行われない。
2. 対処法
アプリの実行ステータスがUIApplicationStateActiveとなる applicationDidBecomeActiveメソッドでプロンプト表示を実行する。