app_tracking_transparency icon indicating copy to clipboard operation
app_tracking_transparency copied to clipboard

I received the rejection on IOS 18.0

Open hanolee opened this issue 1 year ago • 26 comments

image

Is there anyone who does have same issue on IOS 18.0??

hanolee avatar Oct 05 '24 11:10 hanolee

I am using v2.0.5

hanolee avatar Oct 05 '24 11:10 hanolee

我也遇到了。请问你的得到解决了吗?我用的事 2.0.6 版本,也是在 ios 18

3990995 avatar Oct 07 '24 16:10 3990995

I am also facing the same issue. The app tracking permission request pops up in ios version below 18. But the request never appears on ios 18 version. Verified with multiple devices.

Have to identify why the request doesnt appear in ios 18.

IamVNIE avatar Oct 12 '24 05:10 IamVNIE

I too got same issue. Someone suggest me fix

jinosh05 avatar Oct 14 '24 18:10 jinosh05

I implemented the initPlugin() function according to the code provided and encountered the same rejection during Apple's review.

After further investigation, I found that it worked perfectly on my iPhone but caused the issue described in the rejection when tested on my iPad.

However, by increasing the delay in the code from 200 milliseconds to 1000 milliseconds, the problem was resolved, and the app successfully passed Apple's review.

While this may not be a definitive solution, it appears to be an effective workaround for now and should help you get through the review process.

You can refer to the example here for additional details: App Tracking Transparency Plugin.

Screenshot 2024-10-15 at 9 44 35 AM

mooosamir avatar Oct 15 '24 07:10 mooosamir

Actually when I tried it at iOS 18, it didn't worked

jinosh05 avatar Oct 16 '24 09:10 jinosh05

use permission_handler package. It works fine. I've tested

aqueelaboobacker avatar Oct 22 '24 17:10 aqueelaboobacker

Finally found a Solution for this issue. By default this permission is Denied in iOS 18 and some other recently updated iOS platforms. The solution is to guide the user to do the following ''' ' Go to Settings > Privacy & Security > Tracking and check if "Allow Apps to Request to Track"' and enable the permission for this application. '''

In addition to the above message you can add the following code at button on press for making the permission Request easier const url = 'app-settings:'; if (await canLaunchUrlString(url)) { await launchUrlString(url); } else { debugPrint('Could not launch $url'); }

jinosh05 avatar Oct 22 '24 18:10 jinosh05

I had the same problem with iOS 18.0, I couldn't find a solution and trying with permission_handler didn't solve the issue.

Then I noticed that on simulator with iOS 18.1 it was working fine, so I decided to upgrade my iPhone to same versione and the problem has gone.

Could it be an issue with iOS version?

Mapk26 avatar Oct 30 '24 13:10 Mapk26

+1

MortadhaFadhlaoui avatar Oct 30 '24 15:10 MortadhaFadhlaoui

Hello,

Any Update?

ismailcaakir avatar Dec 06 '24 12:12 ismailcaakir

Hello Everyone;

I was able to solve it by downgrading my flutter and dart versions, but I'm sure the library doesn't work on 3.24.x. I think everyone should download 3.22.2.

Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (6 months ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3

ismailcaakir avatar Dec 12 '24 12:12 ismailcaakir

I’ve released an update for one of my apps using the latest Flutter version as of today, Flutter 3.24.5. The update has been successfully tested on both simulators and a physical device running iOS 18.1.1.

Everything is functioning as expected. The app has been reviewed and released without issues. As noted in the documentation, keep in mind iOS’s “one active native dialog” policy, particularly if your app requests additional permissions such as remote notifications or camera access.

Additionally, try to delay ATT (App Tracking Transparency) requests until after handling any other permission requests.

deniza avatar Dec 12 '24 14:12 deniza

Hello @deniza,

I tested this code in the latest version of flutter. It continues to work smoothly. But it was not working in the version I mentioned before.

I think you can mark Issue as solved, everyone can upgrade to the latest version.

Also, the rejections to applications are really true, it happened to me too.

Thanks again for your effort.

ismailcaakir avatar Dec 12 '24 14:12 ismailcaakir

Same issue.

Apple reviewer rejected my app, he/she didn't see ATT dialog on iPadOS 18.1.1. I'm using flutter 3.24.5, app_tracking_transparent: ^2.0.4 (but when view the code it shows 2.0.6)

Please help!

lehuy0000 avatar Dec 13 '24 07:12 lehuy0000

Quite the same for me, except it's iPadOS 18.2 Flutter 3.24.5 app_tracking_transparency: 2.0.6

The app uses the AppTrackingTransparency framework, but we are unable to locate the App Tracking Transparency permission request when reviewed on iPadOS 18.2.

Have this in ios/Runner/Info.plist

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to uniquely identify and track your device for analytics and customization purposes.</string>

Have this in my main screen:

  @override
  void initState() {
    WidgetsFlutterBinding.ensureInitialized().addPostFrameCallback((_) => initAppTracingTransparency());
  }
  
  Future<void> initAppTracingTransparency() async {
    final TrackingStatus status = await AppTrackingTransparency.trackingAuthorizationStatus;
    setState(() => _iOSTrackingStatus = status);

    // If the system can show an authorization request dialog
    if (status == TrackingStatus.notDetermined) {
      // Wait for dialog popping animation
      await Future.delayed(const Duration(milliseconds: 1000));
      // Request system's tracking authorization dialog
      final newStatus = await AppTrackingTransparency.requestTrackingAuthorization();
      setState(() => _iOSTrackingStatus = newStatus);

      // Check every 1s if the user has made a decision - previous await returns notDetermined instantly for some reason?
      if (newStatus == TrackingStatus.notDetermined) {
        Timer.periodic(const Duration(seconds: 1), (timer) async {
          final newStatus = await AppTrackingTransparency.trackingAuthorizationStatus;
          if (newStatus != _iOSTrackingStatus) {
            setState(() => _iOSTrackingStatus = newStatus);
            timer.cancel();
          }
        });
      }
    }
  }

I have even tested just now - the pop up shows up on iOS 18.2 with iPad 13 simulator. We have resubmitted the build, posted the screenshots of their popup inside ipados 18.2 simulator showing up, described where it shows. We'll see how it goes.

Maczuga avatar Dec 13 '24 19:12 Maczuga

Hi @Maczuga, If you have any review results, please let us know here.

lehuy0000 avatar Dec 14 '24 02:12 lehuy0000

Quite the same for me, except it's iPadOS 18.2 Flutter 3.24.5 app_tracking_transparency: 2.0.6

The app uses the AppTrackingTransparency framework, but we are unable to locate the App Tracking Transparency permission request when reviewed on iPadOS 18.2.

Have this in ios/Runner/Info.plist

can you flutter upgrade to latests version?

ismailcaakir avatar Dec 16 '24 07:12 ismailcaakir

Hi @Maczuga, If you have any review results, please let us know here.

My submission was just accepted. Code is exacly the same as when I tried to release it 1 week ago (3 attempts before).

The only difference was that I used latest version of xcode to compile.

Maczuga avatar Dec 16 '24 08:12 Maczuga

Hi @Maczuga, If you have any review results, please let us know here.

My submission was just accepted. Code is exacly the same as when I tried to release it 1 week ago (3 attempts before).

The only difference was that I used latest version of xcode to compile.

My submission was just accepted! My code is the same here https://pub.dev/packages/app_tracking_transparency/example and changes: await Future.delayed(const Duration(milliseconds: 1000)); <== change from 200 to 1000 here

- Flutter 3.27.x ( from 3.24.5) 
- app_tracking_transparency: ^2.0.6 (from ^2.0.4)
- XCode: 15.2 (unchanged)

lehuy0000 avatar Dec 17 '24 01:12 lehuy0000

我也遇到了。请问你的得到解决了吗?我用的事 2.0.6 版本,也是在 ios 18

下面的回答 加了一个 delay 就ok了

Suezp226 avatar Dec 17 '24 08:12 Suezp226

I implemented the initPlugin() function according to the code provided and encountered the same rejection during Apple's review.

After further investigation, I found that it worked perfectly on my iPhone but caused the issue described in the rejection when tested on my iPad.

However, by increasing the delay in the code from 200 milliseconds to 1000 milliseconds, the problem was resolved, and the app successfully passed Apple's review.

While this may not be a definitive solution, it appears to be an effective workaround for now and should help you get through the review process.

You can refer to the example here for additional details: App Tracking Transparency Plugin.

Screenshot 2024-10-15 at 9 44 35 AM

this work to me thank you

Suezp226 avatar Dec 17 '24 08:12 Suezp226

I also had this issue, has mentioned here the issue is regarding “one active native dialog policy", I had a first dialog in the physical device requesting access to local network, then because of that was not showing this one. Since we don't control the "stack of dialogs" I workaround by looping the status and trying to show the dialog until it change status waiting 1 seg between loops.

like this:

Future<void> appTracking() async {
  final TrackingStatus status =
      await AppTrackingTransparency.trackingAuthorizationStatus;
  
  while (status == TrackingStatus.notDetermined) {
    await Future.delayed(const Duration(seconds: 1));
    final TrackingStatus newStatus =
        await AppTrackingTransparency.requestTrackingAuthorization();
    if (newStatus != TrackingStatus.notDetermined) {
      break;
    }
  }
}

This worked perfectly for me

ferolpt avatar Dec 19 '24 11:12 ferolpt

I had the same issue with apple saying it doesnt appear on iPadOS 18.3.1. Fixed by adding the delay.

Edit: Spoke too early. It doesn't always work. I am getting a strange behavior. The first time the app runs, the popup will not show and it will go to "notDetermined" directly. The second time the app runs, it will show.

leossmith avatar Feb 18 '25 08:02 leossmith

因为ATT的弹框问题,多次被苹果官方拒绝,整合一下大家的答案,这次审核一次就过了。

  1. 使用以下方式,一部分的iOS版本中是可行的,但是还有些iOS版本不可行。 Image

Future requestTrackingAuthorization() async { await Future.delayed(const Duration(microseconds: 1000)); TrackingStatus status = await AppTrackingTransparency.trackingAuthorizationStatus; int timeoutCount = 0; while(status == TrackingStatus.notDetermined && timeoutCount < 10){ status = await AppTrackingTransparency.requestTrackingAuthorization(); await Future.delayed(const Duration(microseconds: 300)); timeoutCount ++; } }

2.如果只使用以上方式,iOS版本15.8.3、iOS版本18.3.1从Xcode上安装都是可行的,但是上传到TestFlight下载安装还是没有ATT弹框。所以,需要在iOS 原生端的AppDelegate.M添加以下方式:

Image

#import <AdSupport/ASIdentifierManager.h>

#import <AppTrackingTransparency/AppTrackingTransparency.h>

  • (void)applicationDidBecomeActive:(UIApplication *)application { if (@available(iOS 14, *)) { // iOS14及以上版本先请求权限 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^( ATTrackingManagerAuthorizationStatus status) { // 获取到权限后使用老方法获取idfa if (status == ATTrackingManagerAuthorizationStatusAuthorized) { NSString *idfa = [[ASIdentifierManager sharedManager] .advertisingIdentifier UUIDString]; NSLog(@"%@", idfa); } else { NSLog(@"请在设置-隐私-跟踪中允许App请求跟踪"); } }]; } else { // iOS14以下版本使用老方法 // 判断在设置-隐私里是否打开了广告跟踪 if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) { NSString *idfa = [[ASIdentifierManager sharedManager] .advertisingIdentifier UUIDString]; NSLog(@"%@", idfa); } else { NSLog(@"请在设置-隐私-广告中打开广告跟踪功能"); } } }

这样修改,我重新提交审核一次就过。 后续如果有什么变动,我在来告知!!!

a728384698 avatar Apr 25 '25 02:04 a728384698

Yesterday, I was also rejected for the same reason as the topic starter. After that, I just replied asking them to enable 'Allow Apps to Request to Track' on the device by following this path: SettingsPrivacy & SecurityTrackingAllow Apps to Request to Track.

Today, my app review from Apple has been approved.

thoisolo avatar Sep 22 '25 01:09 thoisolo