我们现在在应用程序上使用社交功能,但是在Facebook模式中遇到了问题。
简而言之,用户浏览到Facebook组,并使用自定义按钮打开包含应用程序的URL。
问题在于以下事实:
有人有同样的问题吗?
预先感谢
编辑
我还附加了代码功能:
function fbLogin() {
$$Loader.start();
Service.getFBAppID().then(
function(res) {
if (res) {
$$FBAuthz.init(res).then(function() {
// Try to show to the user FB login mask
FB.login(function(res) {
if (res.authResponse) {
var token = res.authResponse.accessToken;
$log.debug("INTRO: FB credentials valid. Fetching informations");
// User authenticated successfully on FB
// Try now to authenticate user into GoWeb system
$$User.login(null, null, {
accessToken: res.authResponse.accessToken
}).then(
function(res) {
$log.debug("INTRO: User will be redirect to state requested");
// User FB account exist and he's now authenticated into system
// Redirecting user to requested page
$state.go("home");
}, function(err) {
$log.debug("ERROR INTRO: FB user credentials appear to be not associate with any user in the system");
// System didn't recognize FB credentials inside system
// Try to ask to the user if has a valid app account
$state.go("check_user_account", {
accessToken: res.authResponse.accessToken
});
}
);
} else {
$log.debug('INTRO: User cancelled login or did not fully authorize.');
$$Loader.stop();
}
}, function() {
$log.debug("INTRO: User refused to continue with login process");
$$Loader.stop();
});
}, function(err) {
$log.debug("ERROR INTRO: An error ocurred during FB initialization");
$$Loader.stop();
});
} else {
// If widget is not requested by an external platform treat case normally
$$Loader.stop();
}
});
}
功能由控制器(下图)绑定
vm.fbLogin = fbLogin;
并在HTML中使用,例如belo
<gbo-row gbo-if-widget
gbo-if
condition-value="true"
condition-operator-value="'=='"
condition-provider="TenantService"
condition-provider-field="data.fbEnabled"
condition-provider-async-function="isActive">
<gbo-button gbo-effect
gbo-effect-delay="500"
on-click="vm.fbLogin()"
label="fb_login_action"
gbo-effect-name="fadeBottomTop"
classes-inner-button="col s12 m12 l12 blue"
classes="hidden white-text col s8 offset-s2 m4 offset-m4 l2 offset-l5">
</gbo-button>
</gbo-row>