简体   繁体   中英

Facebook login for Windows app using Javascript and html5

I am developing a windows 8.1 app using javascript and html5. I want to integrate facebook login.When I searched I found the following documentations

1. https://developers.facebook.com/docs/facebook-login/login-for-windows-phone 2. https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.3

which one should I use.

如果仅将应用程序制作为Windows 8,请使用第一个。

I suggest you go through the first link since it mentions how to integrate facebook SDK in windows phone . The other link mentions about Facebook integration through javascript in web .

I tried the first one, I used js function in wp8

    Windows.System.Launcher.launchUriAsync("fbconnect://authorize?cliend_id=My_appId&scope=basic_info&redirect_uri=msft-my_prod_id://authorize").then(function (success){
})

It works for me, If I'm already logged with facebook app, it return true, else it show me Facebook Login Page. But I don't obtain Facebook userId, i'm able only to intercept boolean value for success or not. Did you get a solution for login and obtain Facebook userId?

I found the Winjs sdk for Facebook https://github.com/Thuzi/facebook-winjs-sdk it works for me. For windows phone you need to use Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAndContinue instead of Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAsync during the login

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM