代码之家  ›  专栏  ›  技术社区  ›  developer82

无法打开Facebook登录屏幕

  •  0
  • developer82  · 技术社区  · 9 年前

    我正在尝试创建一个Android应用程序的Facebook登录(iPhone运行良好)。

    这是我的 tiapp.xml (如下所示: http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook ):

     <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
            <application android:theme="@style/Light">
                <activity android:label="@string/app_name"
                    android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
                <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
            </application>
        </manifest>
    </android>
    

    我还添加了 strings.xml 资源。但当我试着打电话给 authorize() 函数I得到以下错误:

    这里缺少什么?

    1 回复  |  直到 9 年前
        1
  •  0
  •   Hans Knöchel    9 年前

    代替 <activity android:label="@string/app_name" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> 具有 <activity android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="YourAppName" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />

    重要的是更换 com.facebook.LoginActivity 具有 com.facebook.FacebookActivity 在这里,Facebook在几年前改变了这一点。有关详细信息,请查看 ti.facebook 存储库。