Yönlendirme URL vs Facebook Connect Ping?

2 Cevap php

Neredeyse facebook siteme ihtiyaç şekilde çalışan bağlamak var, ben hala, aşağıda bu FB ayarlarında altında 3 farklı URL seçenekleri bağlamak liste, belgeleri bağlamak facebook dan bir kaç hata çalışmak gerekiyor. Bir kullanıcı facebook ile benim sitede 1 kez açtığında, ben mysql facebook profili verileriyle profile orada oluşturmanız gerekir, çünkü bu benim için çok yararlı olabilir.

Tamam ben bir yönlendirme URL sadece bir sayfa için tarayıcı yönlendirir anlıyorum ama ben aşağıda kurtarmak bu bağlantıların 2 Callback URL için olduğunu görebilirsiniz, biraz kafam karışık, o yüzden almak URL I facebook yazılan veri sağlamak? Ben haklıysam, nasıl ben Ping geri göndermeden ne veri bilebilir?

1)

Post-Authorize Callback URL: Facebook pings this URL when a user authorizes your application for the first time. You can also call users.isAppUser to determine if the user has authorized your application.

2)

Post-Authorize Redirect URL: You can redirect a user to this URL after the user authorizes your application for the first time. You can use this URL only if the user authorizes your application through login.php and not the login dialog.

3)

Post-Remove Callback URL: Facebook pings the URL when a user removes your application.


Kullanıcı tarayıcıda yönlendirir ben facebook oraya profil verileri almak için bu gibi kod çalıştırabilir ama ben facebook ping verilerle zaman hakkında emin değilim?

$user_details=$fb->api_client->users_getInfo($fb_user, array('last_name', 'first_name', 'proxied_email','birthday_date', 'sex', 'is_app_user', 'current_location', 'about_me', 'activities', 'interests', 'relationship_status', 'pic_big', 'pic_small', 'books'));  

$firstName = $user_details[0]['first_name']; 
.....

2 Cevap

Ben sorunuzu anlamak completelly sanmıyorum, ben ne cevap çalışacağım - eksik bir şey varsa, burada yorum lütfen ve ben buna cevabı düzenlemek edeceğiz.

Haklısınız ping zaman Facebook POST veri gönderir olduğunu varsayıyoruz. Yani, temelde ne (ping için facebook söyledi url) verilen son noktadaki yapardı istediğiniz veriler için $_REQUEST dicti okumaktır. Facebook ping gönderir her parametre listesi bulunabilir here.

Ne olur şudur:

  1. Kullanıcı Facebook Connect ile sitenize bağlanmak için tıklar
  2. O bu çalışmasını sağlar eğer bir Facebook oturum açma sayfası soran kullanıcıya bir onay gösterir
  3. If izin, Facebook asap belirtilen URL'ye POST veri gönderir

Aynı olduğunda kullanıcı sitenizden Facebook Connect ile removes kendisi.

Eğer dikkatlice uç nokta alınan verileri doğrulamak gerektiğini unutmayın. Eğer her yazı isteği üzerine kalıcı verileri oluştururken beri, at least istekleri sadece facebook alınabilir sağlamak.

Alternatif olarak, sadece yetki yere sonra kullanıcıyı yönlendirme, çağrı users_getInfo ve is_app_user doğru olup olmadığını kontrol edebilirsiniz. Eğer öyleyse, size veritabanı üzerinde objeleri oluşturmaya devam.

1) Post-Authorize Callback is the url Facebook will POST some data to when a user authorizes your application/site. This is through ANY means, not just through Facebook Connect. You should keep the user ID that is passed with this so you can track which users have authorized your application/site. You can then use the user ID to send messages to (i.e. notifications) the user, typical app-to-user messages. It's "ping" because Facebook ignores any response you send. You don't respond.

Bir kullanıcı uygulama yetkisi sonra 2), isteğe bağlı olarak Facebook, bu URL'ye kullanıcıya göndermek olabilir. Örneğin, bir hoş geldiniz sayfası ve / veya tanıtım. Bu sadece Facebook platformu altında, Facebook bağlan altında olmaz.

1. 3) tam tersi. Facebook sadece Çıkardığınız birisi / uygulama deauthorized bilmesini sağlar. Yine, cevap gerekmez.

Items #1 and #2 is how you keep track of which user IDs have authorized your application. You cannot query Facebook for this. Facebook writes a cookie under your domain if the user is logged into Facebook and has connected with your site. You can always check for this cookie when a user arrives and log them in automatically to your site. You should verify the cookie data, of course. Instructions for doing that are here: http://wiki.developers.facebook.com/index.php/Verifying%5FThe%5FSignature