login with twitter in ionic cordova not working using $cordovaOauth.twitter

后端 未结 2 2251
臣服心动
臣服心动 2021-01-13 09:37

I want to integrate twitter login to validate user in my hybrid application using Cordova Oauth plugin, followed the instruction from ngcordova oauth.

And demonstrat

相关标签:
2条回答
  • 2021-01-13 09:48

    Have created a working twitterExample and uploaded in github. Please take a look

    Have added the steps below for quick reference.

    Pre-requisites
    Create a twitter app and get Consumer Key (API Key) and Consumer Secret (API Secret).

    Steps
    1) Create a project
    2) cd into the project
    3) Add the required platform(s)
    4) Download "ng-cordova.min.js" and add to js folder
    5) Add the "ng-cordova.min.js" path in "index.html" file just above "cordova.js" path
    6) Add the dependancy "ngCordova" in "app.js" angular module
    7) Add the plugin "cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git" from terminal
    8) Download the "sha1.js" file and add to js folder
    9) Add the "sha1.js" path in index file
    10) Type "bower install ng-cordova-oauth -S" from terminal
    11) Add the "ng-cordova-oauth" file path to index file
    12) Include "ngCordovaOauth" dependancy in "app.js" angular module
    13) Add the "$cordovaOauth" to the controller which is using twitter login function
    14) Add the controller and ng-click in index.html
    15) Add the twitter login function in the controller as show in the app.js (Please replace the api_key and api_secret with your twitter app details)

    Thanks to Nic Raboy for the plugin and blog.

    0 讨论(0)
  • 2021-01-13 09:53

    i used http://127.0.0.1:8080/callback when creating the twitter application and it worked

    0 讨论(0)
提交回复
热议问题