Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use AppEvents.activateApp() in 12.0.0 version

I have updated the FBSDKAppEvents to 12.0.0 version, and the function AppEvents.activateApp() in AppDelegate is now deprecated. I have searched in the Facebook documentation, and unfortunately I didn't found any information about that, and I don't understand what's method I want to use to replace the deprecated:

Deprecated function

The message is: "'activateApp()' is deprecated: The class method activateApp is deprecated. It is replaced by an instance method of the same name."

Did anyone know what code I have to put to replace the deprecated one?

like image 421
M. Mansuelli Avatar asked Jun 09 '21 17:06

M. Mansuelli


Video Answer


1 Answers

I have updated the FBSDKAppEvents to 12.0.0 version and now we can use this code below:

func applicationDidBecomeActive(_ application: UIApplication) {
    AppEvents.shared.activateApp()
}

And some Settings on FDSDKAppEvents changed a little, and now we need to update to Settings.shared, for example:

Settings.shared.enableLoggingBehavior(.appEvents)
Settings.shared.enableLoggingBehavior(.developerErrors)
Settings.shared.enableLoggingBehavior(.cacheErrors)
Settings.shared.enableLoggingBehavior(.uiControlErrors)
Settings.shared.isAdvertiserTrackingEnabled = isEnabled
Settings.shared.isAutoLogAppEventsEnabled = isEnabled
Settings.shared.isAdvertiserIDCollectionEnabled = isEnabled
like image 196
M. Mansuelli Avatar answered Oct 31 '22 10:10

M. Mansuelli