![]() The last thing we must do is to create an app on Twitter that will give us the credentials we need. Our app is now ready to connect with Twitter. įinally, we must add the dependencies to our AngularJS module inside our app.js file: angular.module('starter', ) Make sure to add the ngCordova file before the cordova.js script tag that is already included! We also already included our services, and later, we will create and add a controller. Now, we need to include all these files inside our index.html. ![]() Go to the jsSHA Github project, download it, and copy the sha.js file from the archive into the www/lib/ folder of your app. We’ll start with a simple blank Ionic app, install ngCordova and ngResource (needed for the REST calls later) via the bower package manager and add a Cordova plugin we will need for the OAuth: ionic start devdactic-twitterfeed blank -appname “My Twitter Feed”īower install angular-resource ngCordova -saveĪdditionally, we need the jsSHA Library inside our project, because Twitter requires request signing using HMAC-SHA1. In this post, I will take things one step further and show you how to authenticate with OAuth, make signed calls to the well documented Twitter REST API, and parse the home timeline of a user inside your Ionic app. But what happens after the token authentication? ![]() Lucky for us, we can use the simple ngCordova OAuth wrapper previously described by Nic Raboy to solve the basic authentication. Getting the Twitter timeline of a user into your Ionic app can be a challenging task. Simon often writes about Ionic, web and mobile development. This is a guest post by Simon Reimler, software developer at arvato Bertelsmann, experienced with iOS, Android, AngularJS, Ionic and Python.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |