I’m trying to get the user’s twitter followers emulating on Android.
Buy I’m getting null error:
$ ionic emulate android --livereload --consolelogs
...
0 638883 log Error -> null
Things I’ve tried:
- I added this to the
config.xml
:
<access origin="*"/>
- Added this to the
index.html
:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
- I’ve set the callback url on Twitter to
http://localhost/callback
via http://tinyurl.com/krmpchb
This is my controller:
angular.module('starter')
.controller('AppCtrl', function($scope, $ionicPlatform, $timeout, $cordovaOauth) {
var api_key = "xxx";
var api_secret = "xxx";
$ionicPlatform.ready(function() {
$cordovaOauth.twitter(api_key, api_secret).then(function(result) {
console.log("Response Object -> " + JSON.stringify(result));
}, function(error) {
console.log("Error -> " + error);
});
};
...
Is there another way to debug the issue? is the twitter API permissions? the callback? Content-Security-Policy?