1
我想實現facebook api以在用戶點擊Facebook登錄按鈕時獲取用戶的數據。就是這樣,點擊..去搶json文件並返回它。如何在Android上正確實現Facebook登錄
問題是,開發人員指南有點難以跟蹤我和教程和帖子,我發現的東西都很舊,並使用不推薦使用的代碼..所以我卡住了 我設法代碼:
佈局:
<com.facebook.widget.LoginButton
xmlns:fb="http://schemas.android.com/apk/res-auto"
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
fb:login_text="@string/registrarse_con_facebook" />
的java:
//global variable
LoginButton btnRegisterFb;
.
.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_user);
btnRegisterFb = (LoginButton)findViewById(R.id.login_button);
//permissions is an array of strings with permissions needed
btnRegisterFb.setReadPermissions(Arrays.asList(FacebookHelper.permissions));
}
我很樂意與這個話題一定的指導意義。
如何顯示登錄對話框?我如何獲取用戶數據?
想要簡單的方法嗎?使用這個庫:https://github.com/sromku/android-simple-facebook – sromku
謝謝:)我會檢查出來 – HardCodeStuds
我創建了一個Facebook的登錄頁面使用HTTP在Android ...你想要嗎? ? 該項目將不會處理推送通知,也不會取得聯繫人,並做其他通常Facebook應用程序的東西..它只會登錄到FB,並會顯示FB主頁..你想要嗎? –