-1

我需要在使用 IBM MobileFirst Platform 创建的混合应用程序中实现社交登录(facebook、Google、Twitter 等)。

哪种社交登录方法最适合 mobilefirst 混合应用程序?

对于 Google 登录,我使用带有以下代码的 hello.js。

是否可以在 MobileFirst 中使用以下代码??谷歌将仅通过它提供响应Redirect URIs。我们如何才能获得对 MobileFirst 混合应用程序的响应?

hello.init({ 

    google   : GOOGLE_API_ID
},{scope: 'email' , redirect_uri:'redirect.html'});

hello.on('auth.login', function(auth){

    // call user information, for the given network
hello( "google" ).api("me").then(function(json){
    alert("Your email is "+ json.email);
}, function(e){
    alert("Whoops! " + e.error.message );
});
});

请建议....

4

1 回答 1

0

您最好的方法是找到执行这些登录操作的优秀 Cordova 插件,因为它们是最合适的。

您将需要阅读有关在 MFP 中实现 Cordova 插件的信息:https ://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/adding-native-functionality/

然后尝试实现各种这样的插件(谷歌为他们),直到你找到适合你的应用程序的一个。如果您遇到实施困难,您应该使用我们可以帮助您的实际代码打开一个新问题...

Facebook 选项开始:

于 2015-01-13T04:27:14.710 回答