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

didResolveDeepLink not getting called when launch from background #209

Closed coolioxlr closed 1 year ago

coolioxlr commented 2 years ago

Report

SDK Version

6.6.1

What did you do?

follow the steps to setup UDL https://dev.appsflyer.com/hc/docs/unified-deep-linking-udl-1

What did you expect to happen?

Currently, didResolveDeepLink is only being called when cold start the app. If the app is in the background and open the app through UDL didResolveDeepLink is not being called

What happened instead?

didResolveDeepLink not being called when launched from background

Please provide any other relevant information.

Not very sure what's the expected behavior

gondar-lvovich commented 2 years ago

Hello! Have the same issue. Tried versions from 6.2 to the latest version. I also tried to work with the old api (legacy) and the deep link did not come as well. Found a problem that SDK does not work correctly in some regions. Deeplink does not come to ios application in the didResolveDeepLink function. If you use a vpn client (for example, london), then the service works as expected.


2022-11-15 12:59:54.684544+0300 App[14722:3376118] [AppsFlyerSDK] [com.apple.main-thread] AppsFlyer SDK version 6.8.0 started build (83)
2022-11-15 12:59:54.684730+0300 App[14722:3376118] [AppsFlyerSDK] [com.apple.main-thread] Keychain items migration status: 0
2022-11-15 12:59:54.684762+0300 App[14722:3376124] [AppsFlyerSDK] [com.apple.main-thread] * AppsFlyer is set to debug mode. This should only be used in development environment! *
2022-11-15 12:59:54.684829+0300 App[14722:3376118] [AppsFlyerSDK] [com.appsflyer.serial] [SKAd] Loaded configuration: 4
2022-11-15 12:59:54.684884+0300 App[14722:3376124] [AppsFlyerSDK] [com.appsflyer.serial] [DDL] Delegate: App.AppsFlyerService
2022-11-15 12:59:54.684909+0300 App[14722:3376118] [AppsFlyerSDK] [com.appsflyer.serial] [DDL] DDL already has been resolved
2022-11-15 12:59:54.685159+0300 App[14722:3376124] [AppsFlyerSDK] [com.appsflyer.serial] [HTTP] Operation start: `Config-1`
2022-11-15 12:59:54.685186+0300 App[14722:3376124] [AppsFlyerSDK] [com.appsflyer.serial] [CFG] Initializing `RemoteControl`
2022-11-15 12:59:54.685233+0300 App[14722:3376118] [AppsFlyerSDK] [com.appsflyer.serial] [CFG] isSandbox: false
2022-11-15 12:59:54.685743+0300 App[14722:3376124] [AppsFlyerSDK] [com.appsflyer.serial] [CFG] No update needed
2022-11-15 12:59:54.685856+0300 App[14722:3376122] [AppsFlyerSDK] [afsdk-buffer-serial] [HTTP] Dealloc. Time elapsed for: `Config-1` - 0.001077055931091309
2022-11-15 12:59:54.894822+0300 App[14722:3376122] [AppsFlyerSDK] [com.appsflyer.serial] [ATT.1] waitForATTUserAuthorizationWithTimeoutInterval: 60
2022-11-15 12:59:54.895392+0300 App[14722:3376122] [AppsFlyerSDK] [com.appsflyer.serial] Dynamically loaded library: AppTrackingTransparency
2022-11-15 12:59:54.946317+0300 App[14722:3376122] [AppsFlyerSDK] [com.appsflyer.serial] Dynamically loaded library: AdSupport
ℹ️ requestTrackingAuthorization() [AppsFlyerService.swift:76] Request Tracking Authorization - Authorized
2022-11-15 12:59:55.024223+0300 App[14722:3376118] [AppsFlyerSDK] [com.appsflyer.serial] Start
2022-11-15 12:59:55.027120+0300 App[14722:3376136] [AppsFlyerSDK] [com.appsflyer.serial] [CLS] ASIdentifierManager loaded
2022-11-15 12:59:55.028059+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] [CLS] ADClient not found
2022-11-15 12:59:55.028504+0300 App[14722:3376122] [AppsFlyerSDK] [com.appsflyer.serial] [CLS] FBSDKAppEventsUtility not found
2022-11-15 12:59:55.029095+0300 App[14722:3376122] [AppsFlyerSDK] [com.appsflyer.serial] isFirstLaunch: No, timestamp: 1668502946.293347
2022-11-15 12:59:55.029159+0300 App[14722:3376136] [AppsFlyerSDK] [com.appsflyer.serial] First `start` since application termintaion/installation
2022-11-15 12:59:55.029239+0300 App[14722:3376122] [AppsFlyerSDK] [com.appsflyer.serial] `appsFlyerDevKey`: H*****K
2022-11-15 12:59:55.030508+0300 App[14722:3376123] [AppsFlyerSDK] [com.appsflyer.serial] Looking for previous version date
2022-11-15 12:59:55.030677+0300 App[14722:3376123] [AppsFlyerSDK] [com.appsflyer.serial] Current cached application version: 14.43.1, new version: 14.43.1
2022-11-15 12:59:55.030941+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] Use date3 from storage
2022-11-15 12:59:55.031017+0300 App[14722:3376167] [AppsFlyerSDK] [com.appsflyer.serial] date1: 2022-11-15_120219+0300
2022-11-15 12:59:55.031129+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] date2: 2022-11-15_125954+0300
2022-11-15 12:59:55.031295+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] date3: 2022-11-15_120222+0300
2022-11-15 12:59:55.031438+0300 App[14722:3376167] [AppsFlyerSDK] [com.appsflyer.serial] First launch date: 2022-11-15_120226+0300
2022-11-15 12:59:55.032971+0300 App[14722:3376167] [AppsFlyerSDK] [com.appsflyer.serial] [iAD]: Cached `Apple Search Ads`: Yes, ASA disable: 0
2022-11-15 12:59:55.033131+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] [HTTP] Operation start: `Config-1`
136] [AppsFlyerSDK] [com.appsflyer.serial] [CFG] No update needed
2022-11-15 12:59:55.036090+0300 App[14722:3376167] [AppsFlyerSDK] [com.appsflyer.serial] [CACHE] Caching request...(cache size: 0)
2022-11-15 12:59:55.037051+0300 App[14722:3376167] [AppsFlyerSDK] [afsdk-buffer-serial] [HTTP] Dealloc. Time elapsed for: `Config-1` - 0.003818035125732422
2022-11-15 12:59:55.037117+0300 App[14722:3376136] [AppsFlyerSDK] [com.appsflyer.serial] [HTTP] Operation start: `544-1668506395.030415`
2022-11-15 12:59:55.038211+0300 App[14722:3376167] [AppsFlyerSDK] [com.appsflyer.serial] 
<~+~   SEND Start:   https://launches.appsflyer.com/api/v6.8/iosevent?app_id={here my id}&buildnumber=6.8.0
dvertiserIdEnabled":false,"cksm_v1":"622001c69fb188067a3f5197191f9fd9","ref":"db7329eef4753e02f2f61ae54182f260365b4da62dc7cab86fc41cde012bd3f8;0;0;0;0;0","af_iad_data":{"error":"ADClientErrorTrackingRestrictedOrDenied"},"event":"Launched","date1_2":"2022-11-15_120219+0300","disk":"999\/9999","sessioncounter":"16","date2":"2022-11-15_125954+0300","firstLaunchDate":"2022-11-15_120226+0300","originalAppsflyerId":"1668502939864-8853846","shortbundleversion":"14.43.1","timepassedsincelastlaunch":"229","bundleIdentifier":"my.example.bundle.id"}
2022-11-15 12:59:58.490768+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] Start
2022-11-15 12:59:58.490985+0300 App[14722:3376124] [AppsFlyerSDK] [com.appsflyer.serial] [CLS] ASIdentifierManager loaded
2022-11-15 12:59:58.491014+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] [CLS] ADClient not found
2022-11-15 12:59:58.491102+0300 App[14722:3376124] [AppsFlyerSDK] [com.appsflyer.serial] [CLS] FBSDKAppEventsUtility not found
2022-11-15 12:59:58.491171+0300 App[14722:3376115] [AppsFlyerSDK] [com.appsflyer.serial] isFirstLaunch: No, timestamp: 1668502946.293347
2022-11-15 12:59:58.491934+0300 App[14722:3376124] [AppsFlyerSDK] [com.appsflyer.serial] Time from last launch(session) 3.459401
2022-11-15 12:59:58.493284+0300 App[14722:3376135] [AppsFlyerSDK] [com.appsflyer.serial] Skip launch
unches.appsflyer.com/api/v6.8/iosevent?app_id={here my id}&buildnumber=6.8.0, NSErrorFailingURLKey=https://launches.appsflyer.com/api/v6.8/iosevent?app_id={here my id}&buildnumber=6.8.0, _kCFStreamErrorDomainKey=4}
2022-11-15 13:00:55.117157+0300 App[14722:3376626] [AppsFlyerSDK] [com.appsflyer.serial] [HTTP] 
Error: Error Domain=com.appsflyer.sdk.network Code=0 "Request failed" UserInfo={NSLocalizedDescription=Request failed, NSUnderlyingError=0x2829191d0 {Error Domain=NSURLErrorDomain Code=-1001 "Превышен лимит времени на запрос." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x282910bd0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <AD344E21-3EC0-4637-8A30-A25198FDB4FC>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
), NSLocalizedDescription=Превышен лимит времени на запрос., NSErrorFailingURLStringKey=https://launches.appsflyer.com/api/v6.8/iosevent?app_id={here my id}&buildnumber=6.8.0, NSErrorFailingURLKey=https://launches.appsflyer.com/api/v6.8/iosevent?app_id={here my id}&buildnumber=6.8.0, _kCFStreamErrorDomainKey=4}}}
2022-11-15 13:00:55.117476+0300 App[14722:3376626] [AppsFlyerSDK] [com.appsflyer.serial] Loading conversion data
2022-11-15 13:00:55.117671+0300 App[14722:3376123] [AppsFlyerSDK] [com.appsflyer.serial] [GCD-E01] Delegate is `nil` or does not respond to -[AppsFlyerLibDelegate onConversionDataSuccess:]
2022-11-15 13:00:55.117749+0300 App[14722:3376123] [AppsFlyerSDK] [afsdk-buffer-serial] [HTTP] Dealloc. Time elapsed for: `544-1668506395.030415` - 60.08031105995178
ilonashub commented 1 year ago

I have the same issue (deeplink not being called when the app is in the background) on version 6.9.1. Did anyone found a solution for it?

gondar-lvovich commented 1 year ago

@coolioxlr @ilonashub I previously discovered that the blocking could be related to the local net-provider. Try use custom host via AppsFlyerLib.shared().setHost("host", withHostPrefix: "")

andr-ggn commented 1 year ago

russia blocked *.appsflyer.com. Use latests version of SDK