2016-08-18 43 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