Вопрос

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