0

I am trying to follow the instructions at https://developers.facebook.com/docs/app-events/android#legacy-activation in the section "Legacy SDK Initialization". They say that "in the Facebook SDK for Android v4.18, and earlier, the SDK must be initialized". I am using Facebook SDK v3.23.1. They provide a code to demonstrate how to initialize the SDK. The problem that I am experiencing is that as part of the sample code, they use the following two lines:

import com.facebook.FacebookSdk;
FacebookSdk.sdkInitialize(getApplicationContext());

When I try to do that, I get the following error:

Cannot resolve symbol 'FacebookSdk'

By testing, I realized that import com.facebook.FacebookSdk can only be used from Facebook SDK 4.0.0 and higher, but I am using Facebook SDK 3.23.1. Is there an alternative way to initialize Facebook SDK for SDK v3.23.1?

4

1 回答 1

0

该解决方案是按照https://developers.facebook.com/docs/reference/android/3.23.1/class/AppEventsLogger/中的说明使用 AppEventsLogger 类。我不必初始化 Facebook SDK v3.23.1,而且我想它甚至不可能初始化它,因为它们在 SDK 3.23.1 版本中没有提供这样做的方法。

于 2017-03-01T01:36:39.733 回答