question

softgames avatar image
softgames asked

Redirection

When my web app is redirecting user to another URL, this URL will be opened in web browser. Is any way to redirect user inside web app?
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Offbeatmammal avatar image
Offbeatmammal answered
you need to set the webview to override the default behavior. if you return [i]false[/i] from the sample below it will load the URL in the same webview, if you return [i]true[/i] then it will allow the default intent handler to take control webView = (WebView) findViewById(R.id.webView1); webView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView webView, String url) { return false; } });
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

softgames avatar image
softgames answered
Thanks for your suggestion. Anyway my app is HTML5 app. So I could not use your example.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Softgames, Thank you for writing to us. In order to test the html5 app in the device, you need to launch the app page inside a webview and that would be a part of the wrapper of your app. Basically, the app what you runs in the browser, that can be launched from a native android app having a web view associated with it. In order to test html5 apps you are targeting to publish in Amazon App Store, we provide Amazon Web App tester ( https://developer.amazon.com/sdk/webapps/tester.html). Could you please test your html5 app in our web app tester to check when redirecting user to another URL, that is opened in a web browser or window? If not, you can trust that when your app would be published in the App Store, that would follow the same behavior.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Garret Alfert avatar image
Garret Alfert answered
I'm having the same problem. I need to send the user to an external site as part of the OAuth Implicit Grant Flow. That URL is opened in a web browser and when the user is redirected back to the app it's still in the browser instead of the Web App Runtime. I tested this with the Amazon Web App tester. How do I make sure external URLs are opened within the Web App Runtime?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi All, The URL opened in browser could be due to several reasons: 1. You are using popup to invoke OAuth, popup doesn't exists on device, so browser is invoked. The solution could be asking you to change to use redirect flow. 2. The OAuth provider is not in our OAuth whitelist. Currently only Google, Facebook, Yahoo (and few more) are supported. Please let us know what oauth provider you are using. Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Garret Alfert avatar image
Garret Alfert answered
Hi Sujoy, thanks for your answer. 1. I wasn't using a popup, but the redirect flow. So that wasn't the reason. 2. This actually poses a problem. My particular use-case is that I want to use remoteStorage in my app. remoteStorage (http://remotestorage.io/) is an open protocol for per-user storage. This means, that the user can choose where the app should store its data. The authorization is done via OAuth, but the storage provider can be any arbitrary domain. There is no finite set of providers that could be whitelisted. The user may even use a self-hosted solution on a personal domain. There already is an app on the Appstore that's using remoteStorage, called Litewrite ( http://www.amazon.com/Jan-Christoph-Borchardt-Jorin-Vogel-Litewrite/dp/B00FHYKZFY). And it's not working because of this problem.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Garret, Sorry for the late response. Can you provide us the exact url you are using for OAuth, so that we can add it to our whitelist?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.