简体   繁体   English

iOS设备上的Facebook登录失败

[英]facebook login failure on iOS device

I am making an HTML5 app using cocoonjs, when trying to login into facebook as i click the login button it opens the facebook app or facebook website on safari, after this if i close the facebook app/safari then my app doesnt get notified of this kind of login failure 我正在使用cocoonjs制作HTML5应用程序,当我尝试登录到Facebook时,因为我单击登录按钮,它会在safari上打开facebook应用程序或facebook网站,在此之后,如果我关闭facebook app / safari,则我的应用程序不会收到此通知某种登录失败

how do I detect this? 我该如何检测?

this is my code 这是我的代码

if (this.socialService && !this.socialService.isLoggedIn()) { this.socialService.login(function(session) { self.log(session); if (session.status !== "connected") { console.log("not connected"); } }, { scope: "publicprofile,user_friends" }); } else { console.log("not connected"); }

The documentation for the Facebook js sdk has an example: Facebook js sdk的文档有一个示例:

FB.login(function(response) {
  if (response.status === 'connected') {
    // Logged into your app and Facebook.
  } else if (response.status === 'not_authorized') {
    // The person is logged into Facebook, but not your app.
  } else {
    // The person is not logged into Facebook, so we're not sure if
    // they are logged into this app or not.
  }
});

Check the session.status of your code to check the conditions as shown in the example. 检查代码的session.status以检查条件,如示例中所示。 If status is anything other than connected or not_authorized it could mean that the Facebook app/safari was closed. 如果状态不是“ connected或“ not_authorized以外的其他状态,则可能意味着Facebook应用/野生动物园已关闭。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 删除并还原Facebook帐户后,iOS Facebook SDK登录失败 - iOS Facebook SDK Login Failure after Deleting Facebook Account and Restoring it Facebook IOS SDK登录在模拟器上有效,而不在设备上有效 - Facebook IOS SDK Login works on simulator, not on device iOS Appcelerator Facebook登录-登录事件未在设备上触发 - iOS Appcelerator Facebook Login - Login Event Doesn't Fire on Device Facebook登录设置失败 - Facebook login setup failure 在设备上运行应用程序时,iOS Facebook SDK“用户取消登录”? - iOS Facebook SDK “user cancelled login” when running app on device? IOS中的Facebook登录可以在模拟器上运行,但不能在安装了本机应用程序的设备上运行 - Facebook login in IOS works on emulator but not on device with native app installed 一台设备上的多个用户可在iOS应用中使用Facebook登录 - Facebook login in iOS app for multiple users on one device Facebook 登录 Swift 在设备上不起作用(但在 IOS 模拟器上起作用) - Facebook Login Swift don't works On Device (But do on IOS Simulator) Unity IOS的​​facebook api中的“被玩家取消登录”回调(仅当设备中具有facebook应用程序时) - “Login cancelled by player” callback in facebook api for Unity IOS (only if you have facebook app in device) 使用“添加到首页”屏幕时,iOS HTML5应用程序Facebook登录失败 - IOS HTML5 app Facebook Login failure when 'Add to Home' screen used
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM