I'm trying to come back to my application after redirecting to an external page.
I'm loading www.external.com in the same webview (view the setting OpenAllWhitelistURLsInWebView = YES). It's not an issue with the whitelist rejection, the host is configured with the external hosts plist setting.
The www.external.com contain a simple :
<?php
$url = urldecode($_GET['url']);
header('Location: ' . $url);
?>
And then I want to come back to index.html#my/route The problem is that the absolute path of the main phonegap page is :
file:///var/mobile/Applications/48D1C223-FD34-436E-85BE-8C0B58859ECF/MyApp.app/www/index.html#my/route/
And I get (either on Simulator or on device) a security error:
Failed to load webpage with error: You do not have permission to access the requested resource.
I can't use window.history.back() because I redirect more than one time. By the way, the window.history.back() is working, I come back to my app.
I'm using cordova 2.1 on xCode 4.5.
Thanks in advance!
This is part of the reason I created cordova-plugin-startpage.
Call the startpage.loadContentSrc()
plugin method and it should redirect you back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With