Failing to get the cordova-plugin-geolocation 4.0.1 to work in an iOS app, despite following all instructions. When the app asks for location permission, the geolocation message displays the path of the webview:
/Users/.../Library/Developer/CoreSimulator/Devices/.../www/index.html
rather than the name of the app and the message in the NSLocationWhenInUseUsageDescription string.
I have tried solutions in other answers (1, 2, 3):
The location is not requested until well after the device is ready --- this happens only when the user goes to a particular page in the app.
I have removed and added the plugin many times. All plugin files seem to be where they should be.
The NSLocationWhenInUseUsageDescription is properly set in config.xml and info.plist. And just to be safe, the variable GEOLOCATION_USAGE_DESCRIPTION is also set in config.xml.
Please help!
It turns out that we had overlooked a solution that has already been suggested (here and here) by others. Namely, cordova.js must be included in index.html. This is not documented in the Cordova geolocation plugin.
Related
Expo documentation on expo-facebook says I need to add facebookScheme setting to my app.json file.
To acquire it, the documentation says for me to access the Facebook documentation.
The Facebook documentation says I need to configure a bunch of stuff which requires a Xcode project. For example, configure Info.plist file, or install some dependencies which require Cocoapods.. etc.
But Expo does not expose this file to me, it's an Expo project after all!
What do I do here then? Do I need to associate this Expo project to an Xcode project, somehow? Do I need to eject from Expo?
Just to add some context (which might be relevant or not), the main reason I'm asking this is because when I try to login using Facebook on iOS, my app simply crashes (a SIGABRT error)! I suspect it is because of this missing facebookScheme field.
Thank you
For crystal clarity because I'm even dumber than OP, you gotta get whatever the string value is after CFBundleURLSchemes. Literally put the following in your app.json:
{
"expo": {
"facebookScheme": "fb<probably_your_fb_appId_here>",
"facebookAppId": "<definitely_your_fb_appId_here>",
"facebookDisplayName": "<your_app_name_here>",
"facebookAutoLogAppEventsEnabled": false,
"facebookAdvertiserIDCollectionEnabled": false
},
"name": "external_login"
}
For a fully functioning app, you're gonna need the other values that come with the app.json too.
So, I'm dumb.
I thought I had to follow the steps mentioned on FB's documentation, but that was not it. I simply had to access it, go straight to step 4 and copy the values CFBundleURLSchemes (which is the facebookScheme I was looking for), FacebookAppID and FacebookDisplayName, then paste then inside app.json file.
Remember to be logged in with your FB dev account and select your FB app on step 1 inside FB's documentation mentioned above.
This solved the issue about my app crashing as soon as I clicked the FB button.
I have been trying to upload an iOS app to Appstore but its only appearing on "Activity" tab for 3-5 minutes and then disappears.
Then I got an email from Apple saying that my app is rejected because it is using UIWebView in one of the view controller. I deleted that particular screen and reuploaded the app and had the same error email.
Then I checked my third-party sdks like FacebookLoginSDK and GoogleSignInSDK and updated those and then checked that if the app has no UIWebView which it did not. Then i reuploaded the app but this time again I had the same error email. I have searched the whole storyboard source code and the whole app code to look that if there is any sign for UIWebView but there is nothing, but still I am getting this email.
I also tried deleting 'Derived Data' folder several times and cleaning the build folder also but nothing helps.
On the other hand I have uploaded a different app today which had UIWebView and it got approved but I also got the same email for not using UIWebView.
Does anybody had this kind of experience or can anybody tell me whats going on ?
I got the same issue before.
If you have uploaded the build and showing it in activity tab for few minutes then its not mean that issue is only about UIWebview but there can be some other issue as well.
I have uploaded my app n got the mail related to UIWebview, so I coverted the UIWebview to WKWebView and again I uploaded but that time same thing happend.
I failed to tackle the problem.
Then I mailed to Apple Developer Support and they replied like
Any of the third party library internally using some privacy data you should ask permission for the same.
Then I checked Info.plist, I have given each permission in list still how it comes that we don't understand.
Finally then after whole search the one third party library internally using motion related data without permission so this happened.
Then I have added that in plist and then again uploaded and its approved.
So please you can check your info.plist and also check whether your third party library using any privacy sensitive data without permission or not.
May it help you at some point.
Make sure you update all your plugins to the latest version!
Check this: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation where you can find the plugins that have known issues concerning the old WebView usage.
But be aware that uninstalling and re-installing some plugins will NOT will not install the latest available version of the plugin!
So to be sure that you are re-installing the latest version of a plugin, go to the github repository of the cordova plugin and search for the plugin.xml file and open it. Then, copy the version string found in the root xml element.
Finally, install the plugin like that: ionic cordova plugin add plugin_name#copied_version
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-firebase" version="2.0.5"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<name>Google Firebase Plugin</name>
...
...
...
</plugin>
Are you using the AdMob plugin?
It is not enough to check for the absence of "UIWebView" strings!
You have to make sure that all third party plugins are up to date.
One of the trickiest situations I had went to is when I had tried to update an app (using AdMob) on the AppStore after Apple started rejecting apps using the UIWebView.
The generated iOS source code has no UIWebView references, but still rejected!
After a long headache, I realized that the Google AdMob SDK version I'm using is out of date, knowing that I had updated the AdMob plugin from the CLI, but it seems that the SDK is not updated when updating from the npm.
Finally, I had downloaded the latest AdMob SDK from this link https://developers.google.com/admob/ios/download and replaced it in the source code of the AdMob SDK plugin. Then I had followed the instructions found in this link https://developers.google.com/admob/ios/quick-start to update the code in the xCode.
Hot code push is not updating iOS users of Meteor Cordova apps. If I add .pngs, fonts, or other assets to my app and push them to the server, the Android users get the HCP update, but iOS users don't.
Some users report it even is caused by upgrading to Meteor 1.8 without changing any assets.
I can't get any code updates to iOS customers. Can anyone help?
This is a known problem in the Meteor Cordova plugin that makes hot code push (HCP) happen. As discussed in the Meteor forums, which I'm linking here because the links are stable and the discussion is long, the problem is due to __cordova/manifest.json containing duplicate versions of every asset, one with __cordova in the "url" field, and one without __cordova in the "url" field. The webapp plugin tries to copy/move both versions into the update on the phone during HCP, and the 2nd version, being a duplicate of the asset, fails because the asset already exists due to it having just been updated by the first instance of the asset in the manifest.
You can work around this by putting your assets in a CDN instead of locally in your /public directory and changing the references to them in your code accordingly, but that won't solve it if the Meteor upgrade to 1.8 has asset updates, which it seems to for some users.
You can also apply the workaround bug fix provided here https://github.com/meteor/cordova-plugin-meteor-webapp/pull/59, but this requires updating the iOS phone version of your app so that users can get the fix, at which point you could also have updated your assets in the iOS update to get around the problem, but you'd have the fix for future HCP to work.
Details at:
https://github.com/meteor/meteor/issues/10181
https://github.com/meteor/meteor/issues/10277
https://github.com/meteor/cordova-plugin-meteor-webapp/issues/56
https://github.com/meteor/cordova-plugin-meteor-webapp/pull/59
I am using this plugin.
https://github.com/EddyVerbruggen/cordova-plugin-googleplus
The implementation works fine for android. But google sign in on iOS opens safari webview and throws 400 invalid_request.
I am using the ios client id and reverse client id generated on google developer console.
Anyways to debug or know what the issue is?
The usual cause of this error is having an incorrect REVERSE_CLIENT_ID. Double check that you have the REVERSE_CLIENT_ID from the plist file downloaded when you set up the iOS application registration on the Google developer console. Note that if you got it wrong, changing this is difficult, as it gets copied into various locations and won't update automatically if you just try to change it in config.xml. When I mistakenly used my Android client ID to set up the plugin, I found that as well as config.xml I also needed to change the top level package.json file, and the <appname>-Info.plist in the platforms/ios directory in order to get the correct ID used.
I'm developing an iOS app using Cordova 3.3.0. In my config.xml, I have the following:
<access origin="https://*.kidsintouch.com" />
Theoretically, that should stop my app from accessing any resources that try to load outside that domain.
However, when I run the app in the simulator or on device via Xcode, I can access images from any domain.
The PhoneGap docs say :
Unlike the Android platform noted above, navigating to non-whitelisted domains via href hyperlink on iOS prevents the page from opening at all.
However, I'm still able to put an external link on a page in the app and click on it.
When I run the app in Xcode, I see the following console output:
2014-01-02 06:47:16.469 Kids In Touch[10454:60b] Multi-tasking -> Device: YES, App: YES
2014-01-02 06:47:16.480 Kids In Touch[10454:60b] Unlimited access to network resources
2014-01-02 06:47:17.276 Kids In Touch[10454:60b] Resetting plugins due to page load.
2014-01-02 06:47:18.157 Kids In Touch[10454:60b] Finished load of: file:///var/mobile/Applications/8DBB3EE2-A33D-4523-A51F-B72AJ21E5338/Kids%20In%20Touch.app/www/index.html#/intro
2014-01-02 06:47:19.629 Kids In Touch[10454:60b] Resetting plugins due to page load.
The Unlimited access to network resources clearly shows something is wrong. When I click on a bogus link to Google I put in the app, the console displays:
2014-01-02 06:47:20.755 Kids In Touch[10454:60b] Finished load of: https://www.google.com/
So clearly my access origin restriction is not actually restricting anything.
Is there something I am doing wrong? How do I prevent my app from accessing any resources outside the domain I've provided?
Thanks
I found the problem with this. For some reason, the config.xml file produced by cordova build ios is NOT the same as I have in my www folder.
There seems to be some default info in it THEN my real info from www/config.xml is appended to it. At the top of the default config info is <access origin="*" />.
So, the app is allowed all access.
I tried completely blowing out the existing config.xml by running cordova platform remove ios and then rerunning cordova build ios. This did not work. Each time I build, some default stuff is prepended to my real config.xml.
Cure for now until I dig deeper is to manual edit the config.xml after every build. When I do this and try to access a domain not configured with access origin, I get:
ERROR whitelist rejection: url='http://0.0.0.0:8080/accounts'
So, whitelisting works properly, but I've got a wonky build process to resolve.
UPDATE : There is a file platforms/ios/cordova/defaults.xml that contains the default settings for an XML file. It has the access origin * in it. I deleted that and a few other settings and can now build properly respecting the config.xml in my www folder.
All is well. Strange that these defaults get put into my final config.xml.
I ran into this problem too. As an alternative to deleting the defaults, you can ensure that your tags are placed immediately after the tag in the config.xml.