I try to click the FacebookSDK login button and get an error

that my applicaitonId is null.

how can I init it properly?

            Session currentSession = sessionTracker.getSession();
            if (currentSession == null || currentSession.getState().isClosed()) {
                sessionTracker.setSession(null);
                Session session = new Session.Builder(context).setApplicationId(applicationId).build();
                Session.setActiveSession(session);
                currentSession = session;
            }
有帮助吗?

解决方案

Include below line of code in you manifest.xml

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>

and

<string name="app_id">Your Facebook App Id</string>

in res/values/strings.xml

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top