AppsFlyerSDK / AppsFlyerFramework

AppsFlyer Apple SDK
https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS
Other
173 stars 92 forks source link

Organic install with deferred Deeplink and denied App Tracking Transparency. #298

Open ruslanSanarkhin opened 3 months ago

ruslanSanarkhin commented 3 months ago

Version 6.12.0

Preconditions:

1) Created universal link, provided links support. 2) Integrated sdk with deferred deep links support. 3) Released app, checked deferred Deeplink with test device.

Problem:

I can see that deferred deeplinks work only with accepting App Tracking Transparency on iOS 14.5+. So what happens in my code:

1) Initialise SDK + add waitForATTUserAuthorization in func application(_ application: UIApplication, didFinishLaunchingWithOptions

2) In func applicationDidBecomeActive

if let networkManager = NetworkReachabilityManager(), networkManager.isReachable {
            AppsFlyerLib.shared().start()
        }
        if #available(iOS 14, *) {
            ATTrackingManager.requestTrackingAuthorization { (status) in
                switch status {
                case .denied:
                    print("AuthorizationSatus is denied")
                case .notDetermined:
                    print("AuthorizationSatus is notDetermined")
                case .restricted:
                    print("AuthorizationSatus is restricted")
                case .authorized:
                    print("AuthorizationSatus is authorized")
                @unknown default:
                    assertionFailure("Unknown status")
                }
            }
        }

After review about empty internet connection before initialising SDK, I added checking on connection before starting SDK and SDK will start only after accepting WLAN or other network (approved).

The problem is that if I use link + will accept ATT = success deferred deep link result Example log:

{
  "click_time" : 2024-08-01 12:29:08.498
  "is_branded_link" : <null>
  "match_type" : probabilistic
  "af_sub2" : <null>
  "campaign_id" : <null>
  "adgroup" : <null>
  "is_retargeting" : true
  "install_time" : 2024-08-01 12:29:39.689
  "clickid" : 124fdssffsacsdgsb2
  "CB_preload_equal_priority_enabled" : 0
  "media_source" : Test30
  "af_click_lookback" : 7d
  "orig_cost" : 0.0
  "af_sub1" : <null>
  ....
}

If I use link and discard ATT = fail and organic install. Example log:

{
  "af_status" : Organic
  "is_first_launch" : 1
  "install_time" : 2024-08-01 12:20:47.694
  "af_message" : organic install
}

Can someone help to introduce what’s happened and why .denied status is not tracking deffered deep link?