0

I am implementing OAUTH in android using appcelerator. login page is redirecting to response page with token appended to query string e.g. http://mysite.com?access_token="token"

So I need to fetch this query string using appcelerator.

I have used Ti.App.getArguments() but this api is only working for ios not for android.

Is there any api available for fetching query string in appcelerator that works in android??

1 Answer 1

1

Add an event listener to the webview like so:

webview.addEventListener('load', function(e){
    var url = e.url.split('?');
    var urlParams = url[1];
});

The variable urlParams will contain a string that looks like param1=value1&param2=value2 so from there you just need to split them up and find the access_token param.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks I have already figured out this solution and yeah it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.