2016-08-18 29 views
0

我想为我的PhoneGap应用程序实现Twitter登录。
我搜索了一些PhoneGap的Twitter插件,但没有符合我的要求。来自PhoneGap应用程序的Twitter登录

被列为官方PhoneGap插件的Twitter插件需要在Fabric上创建帐户,我不喜欢。 https://github.com/ManifestWebDesign/twitter-connect-plugin

另外一个方法,建议使用inAppBrowser: http://www.oodlestechnologies.com/blogs/Twitter-integration-on-PhoneGap-using-ChildBrowser-and-OAuth-for-iOS-and-Android-Platforms

,我们需要有这样的HTML页面的依赖,也还不是很清楚它是如何工作的。 (以上链接提供的信息有关使用ChildBrowser,但我不知道如何去改变它使用inAppBrowser)

在下面插件只支持iOS的没有一款Android:
https://github.com/etiennea/phonegap-twitter-plugin

所以基本上什么是最好的方法提供基于PhoneGap的应用程序的Twitter登录,该应用程序可以在iOS和Android平台上运行。

回答

0

如果您使用的科尔多瓦用$ cordovaOauth社会登录

请参见我的文章的回答Here得到一步一步的解决方案。我用$cordovaOauth plugin,它为我工作。

$scope.twitterLogin = function() { 
$cordovaOauth.twitter("6VjHDXXXXXXXXXXXX", "erN45XbC3b35XXXXXXXXXXXX").then(function (result) { 
    alert(JSON.stringify(result)); 
}, function (error) { 
    alert(JSON.stringify(error)); 
}); 

}

+0

感谢您的详细信息,但我已经看到这个帖子。 – User7723337

+0

您的要求与此不同吗? –

+0

其实我不习惯使用第三方JS库和代码。我支持iOS和Android的PhoneGap插件。我打算使用链接中指定的方法----> http://www.oodlestechnologies.com/blogs/Twitter-integration-on-PhoneGap-using-ChildBrowser-and-OAuth-for-iOS-and-Android-平台 – User7723337

相关问题