문제

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