AppsFlyerFramework icon indicating copy to clipboard operation
AppsFlyerFramework copied to clipboard

SceneDelegate only apps, missing .start()?

Open rromanchuk opened this issue 5 years ago • 2 comments

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()
}

rromanchuk avatar Oct 20 '20 06:10 rromanchuk

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.

rromanchuk avatar Oct 23 '20 08:10 rromanchuk

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.

freddy1h avatar Dec 01 '20 16:12 freddy1h