问题描述
我在Android Studio中使用了facebook-android-sdk-4.19.0,并按照(点击快速开始按钮,用你自己的facebook账户登录)。在指南中,它被要求在代码段中复制并粘贴以下代码以跟踪应用程序日志
I'm using facebook-android-sdk-4.19.0 in Android Studio and I followed the Facebook quick start guide at https://developers.facebook.com/docs/android/getting-started (Click on the Quick Start button to sign in with your own facebook account). In the guide, it's told to copy&paste the following code in the snippet to track app logs
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
}
}
但是,当我复制粘贴在android工作室的代码,似乎所有的FacebookSdk.sdkInitialize()方法已被弃用。这里的文档是什么也不介绍使用什么方法来初始化sdk而不是sdkInitialize()。我应该使用什么方法?
However, when I copy pasted the code in android studio, it appears that all of the FacebookSdk.sdkInitialize() methods are deprecated. The documentation here https://developers.facebook.com/docs/reference/android/current/class/FacebookSdk/ tells nothing about what method to use to initialize the sdk instead of sdkInitialize(). What method should I use?
推荐答案
从有关升级SDK的文档:
From the documentation about upgrading SDK:
参考:
更新
在SDK 4.22中标题
,描述
, caption
和 image
FBSDKShareLinkContent
已被弃用。考虑将其从使用中删除。
In SDK 4.22 the title
, description
, caption
and image
field of FBSDKShareLinkContent
are deprecated. Consider removing them from usage.
这篇关于不推荐使用FacebookSdk.sdkInitialize(Context)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!