I'm integrating facebook SDK in my app as an option to login for the users. But recently I have started getting FacebookSdk.sdkInitialize(getApplicationContext())
as Deprecated
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolBar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);
So after hustling for long I was able to find the solution to this.
Simply do not write this line of code in your class
FacebookSdk.sdkInitialize(getApplicationContext());
So according to the latest facebook documentation we now don't need to initialize the facebook SDK and it automatically gets invoked. So now FacebookSdk.sdkInitialize(getApplicationContext())
can be deleted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With