问题
How can I set a twitter callback, it doesn't support sp://
my code is
auth.showAuthenticationDialog('https://api.twitter.com/oauth/authorize?oauth_token=' + result.oauth_token, 'sp://geoholium',{
onSuccess: function(response) {
authenticated = true;
access_token = response.split('=')[1];
},
onFailure: function(error) {
},
onComplete: function() { }
});
回答1:
auth.showAuthenticationDialog
works by watching for requests to the URL given in the second parameter, then intercepting them and passing it to you in the callback instead.
With that in mind, you can set the callback URL to whatever is needed for Twitter's API — for example, http://mywebsite.com/twitterIsDone
— the request to http://mywebsite.com/twitterIsDone
will be intercepted for you and will never actually take place.
来源:https://stackoverflow.com/questions/9531709/twitter-ouath-callback-in-spotify-apps