AppsFlyerFramework
AppsFlyerFramework copied to clipboard
SceneDelegate only apps, missing .start()?
Shouldn't start() be added to sceneDidBecomeActive? func applicationDidBecomeActive(_ application: UIApplication) is NOOP in my case and missing from here https://support.appsflyer.com/hc/en-us/articles/207032066-iOS-SDK-V6-X-integration-guide-for-developers#integration
SDK setup seems to work when moving to scene delegate.
func sceneDidBecomeActive(_ scene: UIScene) {
AppsFlyerLib.shared().start()
}
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622956-applicationdidbecomeactive
Warning
If you are using scenes (see Scenes), UIKit will not call this method. Use sceneDidBecomeActive(_:) instead to restart any tasks or refresh your app’s user interface. UIKit posts a didBecomeActiveNotification regardless of whether your app uses scenes.
I emailed their support team and they responded with this
So basically yes, when you use sceneDelegate, applicationDidBecomeActive is not called. However didBecomeActiveNotification is called. So what we suggest is to add an observer to this notification and when the notification is triggered, to call start. Why we suggest this rather than in sceneDelegate ? Because we want to keep the launch of the SK = launch of the app. And not the launch of a specific scene as there could be multiple scenes.