I'm using Xcode to build an iOS app..
I'm trying to get google maps working on Phonegap 3.x but in the debug window it says:
2014-05-22 15:05:14.789 foo[9345:4503] ERROR whitelist
rejection:
url='https://maps.googleapis.com/maps/api/js?key=XXX&sensor=true'
Config.xml:
<access origin="*" />
I've tried this as well:
<access origin="*.googleapis.com" />
my-app.plist:
ExternalHosts | (String) | *
It doesn't seem to work at all!
Any ideas?
Solved!
In Xcode you can see the config.xml.. HOWEVER, it isn't the right config.xml.
The file to search for is here /path-to-app/platforms/ios/appname/config.xml
Just added:
<access origin="*" />
And woila!!
Hope this will help you to!
Related
Trying to use the cordova-ios 4.0 so that I can take advantage of the wkwebview.
On ios9 devices, everything works using the wkwebview.
On ios8 and ios9 devices, XHR requests do not work at all when using the uiwebview (and ios8 seems to use the uiwebview instead of wkwebview).
If I "downgrade" to cordova-ios 3.8, everything works fine. I have the whitelist plugin installed, with the following in my config.xml:
<access origin="*" />
<access origin="tel:*" launch-external="yes" />
<access origin="geo:*" launch-external="yes" />
<access origin="mailto:*" launch-external="yes" />
<access origin="sms:*" launch-external="yes" />
<access origin="market:*" launch-external="yes" />
<allow-navigation href="*" />
<allow-intent href="*" />
<allow-navigation href="*" />
Weirdly, the config.xml seems to be ignored. When I build with cordova-ios 3.8, I get the splash screen, icon, etc. When I build with cordova-ios 4.0 everything is just generic cordova icon/splash.
I have also added the NSAppTransportSecurity bit to the plist file, though for ios8 it shouldn't make any difference.
The XHR calls I'm trying to make have CORS enabled on the server.
Specifically, I need help trying to figure out why I cannot make XHR requests on cordova-ios 4.0.
So, apparently I needed to install the whitelist plugin at version 1.1.1-dev, rather than 1.0.0. I'm not sure what exactly the difference is, but the former fixes whatever issue I was having. Whoops.
I'm using Phonegap Build to compile a game I made using Construct 2.
Now when I install the game on my iphone a geolocation permission alerts pops up, although my game doesn't use geolocation.
I think phonegap somehow inserts geolocation code into the .ipa file
I thought this wasn't gonna be a problem, but I submitted the game to the appstore and the reviewer is asking me what features of my game use geolocation. My game status in itunes connect right now is 'metadata rejected' because of this.
Is there a way to remove this geolocation thing?
I already googled the problem but I can't find a solution.
Here's my config.xml file:
> <preference name="permissions" value="none"/> <preference
> name="android-targetSdkVersion" value="21" /> <feature
> name="http://api.phonegap.com/1.0/network"/> <gap:config-file
> platform="ios" parent="UIStatusBarHidden"><true/></gap:config-file>
> <gap:config-file platform="ios"
> parent="UIViewControllerBasedStatusBarAppearance"><false/></gap:config-file> </widget>
#gleegum, when you install the plugin via config.xml, it will initiate the Geolocation permission sequence. Did you perhaps accidentally insert the geolocation plugin into your config.xml? -Jesse
I have an issue with integrating Twitter timeline with PhoneGap 3.1.0 application (iOS version)
1) I have generated a new PhoneGap 3.1.0 application
2) Have added iOS version
3) I have generated a timeline widget in Twitter
4) Have pasted the code from Twitter widget into the page:
index.html:
<a class="twitter-timeline" href="https://twitter.com/bill_hallam" data-widget-id="399136844954087424">Tweets by #bill_hallam</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
5) Have whitelisted twitter domains:
config.xml:
<access origin="https://twitter.com" subdomains="true" />
<access origin="http://twitter.com" subdomains="true" />
<access origin="http://platform.twitter.com" />
<access origin="https://platform.twitter.com" />
<access origin="https://cdn.syndication.twimg.com" />
<access origin="http://cdn.syndication.twimg.com" />
6) Started the iOS emulator from Xcode
Result: The page is blank. Safari Develop console shows that twitter <iframe> tag is embedded in the page. All js/css files retrieved successfully. None if them was blacklisted.
Does anyone have succesfull experience integrating Twitter timeline into PhoneGap 3.1 app?
Update Nov 29 2016
This is most probably not the issue the OP faced back then, but if anyone faces the same issue these days (using Cordova 6.4.0, as of Nov 29 2016), the answer is to add:
<allow-navigation href="about:*" />
to your config.xml.
This is required to be able to open the about:blank URL initially used by the iframe set up by the Twitter timeline widget.
I have finally figured out a way to do that.
Unfortunately at the moment the only solution I have found is using an InAppBrowser plugin.
But it works for both - iOS and Android versions.
The detailed description is here
I have created a small public page, that functions as a service.
I realise this is a common problem and has been asked many times, however I do feel that no other answers work in this instance.
I have a basic PhoneGap application that works fine in browser, on the Android simulator, on Android devices in the XCode/iOS simulator. It does not work, however, on iOS devices. When adding external libraries the app essentially hangs. It doesn't crash, but tries to load it forever more, leaving a blank white screen.
I know this is a common problem, fixed by amending the config.xml to whitelist URLs, which I believe I have done, but I still get the same problem.
My config.xml has the following entry:
<access origin="*" subdomains="true" />
I have also tried the following:
<access origin="*" />
<access origin="*" subdomains="true" />
<access origin=".*" />
<access origin=".*" subdomains="true" />
All together and on their own, with no luck. After building to iOS (phonegap local build ios) I have also 'prepared' all of the plugins (cordova prepare).
I have tried several libraries, from various CDNs such as Google CDN and jQuery CDN. I have also tried adding an iframe with the following:
<iframe src="http://google.co.uk" width="250" height="500"></iframe>
Which gives me a blank iframe.
If I look at the build in XCode and look at the generated platform-specific config.xml files I can see the same access XML as expected.
I am using the below versions:
Phonegap 3.1.0-0.15.0
XCode 5.0
OSX 10.8.5
iOS 6.1.3 (iPod Touch)
iOS Simulator for iOS 7
Any help is much appreciated.
When i build my application from phonegap. It works in iPhone, iPad, Android but didn't work in blackberry.
I'm calling cross domain API WSDL.
In blackberry it gives error
URL (exmple :- http://google.com)- could not be retrieved because it was not found in config.xml.
Please verify the <access> elements in the WebWorks config. Contact your service provider if the problem persists.
I have to use in config.xml
<access subdomains="true" uri="*" /> OR <access origin="*" />
?
Last time I had this issue it seems all URL's have to be explicit for BB. If your URL is unknown at runtime (For instance, a user entered URL), The only way around it would be
<feature id="blackberry.app" >
<param name="websecurity" value="disable" />