Skip to content

sarbwarraich/ionic_twitter_login

 
 

Repository files navigation

ionic_twitter_login

A step by step and working example of twitter login using ionic and ng-cordova-oauth

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)

Reference:
http://blog.ionic.io/oauth-ionic-ngcordova/
https://github.com/nraboy/ng-cordova-oauth

Thanks to Nic Raboy for the plugin and blog.

About

An step by step and working example of twitter login using ionic and ng-cordova-oauth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.7%
  • CSS 15.3%