Search code examples
androidfacebookfacebook-android-sdkandroid-facebookfacebook-sdk-4.x

AppEventsLogger.deactivateApp(Context context) deprecated


I'm using Facebook SDK for Android v4.20. When I want to call AppEventsLogger.deactivateApp(getApplication()); in my Activity's onPause() it shows as deprecated. I'm using Android Studio 2.3, the app minimum SDK is 16 and target is 25, I use build tools v25.0.2.

It seems to be similar to this SO question but the solution doesn't work and Android Studio is still showing this method as deprecated.

enter image description here

What might be the reason of this warning?


Solution

  • I ran into the same issue. The documentation provided on Facebook does not mention anything about this(AFAIC), however, I noticed that the following message was logged out on LogCat:

    W/com.facebook.appevents.AppEventsLogger: deactivateApp events are being logged automatically. There's no need to call deactivateApp, this is safe to remove.

    That being said, I'm assuming that there is no longer need for the method .deactivateApp();

    Hope it helps :)