Add Camera Usage Description for IOS - ios

I was trying to add Camera Usage Description for my devextreme cordova mobile project but testing it in ios device only get generic message.
I tried adding this code in my config.xml
<plugin name="cordova-plugin-camera" onload="true" />
<config-file platform="ios" parent="NSCameraUsageDescription" target="*-Info.plist" overwrite="true">
<string>We are using a camera to enable you to upload pictures of documents</string>
</config-file>
<config-file platform="ios" parent="NSPhotoLibraryUsageDescription" target="*-Info.plist" overwrite="true">
<string>We are using your pohoto library to enable you to download and save pictures of documents</string>
</config-file>
I tried the suggestion on this link
Build Custom Application Template
But upon building native package in ios I get error.
Error build iOS package: Value cannot be null. Parameter name: buffer
Can anyone help me on this? Or do you have any suggestions creating Camera Usage Description without creating custom application template for devexpress?

Add this line of code in your config.xml
<plugin name="cordova-plugin-media-capture" source="npm" spec="1.4.1" >
<variable name="CAMERA_USAGE_DESCRIPTION" value="We are using a camera to enable you to upload pictures of documents" />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="We are using your pohoto library to enable you to download and save pictures of documents" />
</plugin>

Add this in your iOS project .plist under "Privacy - Camera Usage Description"

Related

Ionic app does not remove local data after uninstalling

I have found a solution for Android but not able to get one for iOS.
I logged into my app
Perform some tasks that save data in local storage
Go to Home and uninstall the app
Install App again
All previously stored data reappear
It should remove all data upon uninstallation.
If you are using Cordova, add the following in your config.xml-
For iOS
Inside <platform name="ios">-
<preference name="BackupWebStorage" value="none" />
Default value is cloud. https://cordova.apache.org/docs/en/latest/config_ref/index.html
For Android
Inside <platform name="android">-
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:allowBackup="false" android:fullBackupContent="false" />
</edit-config>

How does iOS perform localization in Cordova / Phonegap build?

I am trying to display my app name in different languages.
English
Chinese (Simplified)
Chinese (Traditional)
I am using phonegap build to build the app so cannot use xcode.
Therefore, I have created 3 folders which contain respective InfoPlist.strings file manually on res folder like:
en.lproj/InfoPlist.strings
zh.lproj/InfoPlist.strings
zh-hant.lproj/InfoPlist.strings
Example of InfoPlist.strings file inside zh-hant.lproj folder:
My config.xml has these lines to copy to respective folder and also use it respectively.
<resource-file src="res/zh-hant.lproj" target="zh-hant.lproj" />
<resource-file src="res/zh.lproj" target="zh.lproj" />
<resource-file src="res/en.lproj" target="en.lproj" />
<!-- copy localization file -->
<resource-file src="res/zh-hant.lproj/InfoPlist.strings" target="zh-hant.lproj/InfoPlist.strings" />
<resource-file src="res/zh.lproj/InfoPlist.strings" target="zh.lproj/InfoPlist.strings" />
<resource-file src="res/en.lproj/InfoPlist.strings" target="en.lproj/InfoPlist.strings" />
<config-file platform="ios" parent="LSHasLocalizedDisplayName" mode="replace">
<true />
</config-file>
<edit-config target="CFBundleLocalizations" file="*-Info.plist" mode="overwrite">
<array>
<string>en</string> <!-- english -->
<string>zh</string> <!-- chinese (simplified) -->
<string>zh-hant</string> <!-- chinese (traditional) -->
</array>
</edit-config>
The problem is that when I install the app on iPhone the translation is not working. My current language set to English, I get the English name.
When I change language to chinese it does not reflect (translation not working, i.e still in English).
How do I fix this ? Is there anything I am missing ?
If you wish to debug localisation, you need to edit your scheme, as explained here.

How to localize app name in cordova for iOS?

I am looking for a solution to localize my app's name in:
English (EN)
Chinese (Simplified) zh-Hans
Chinese (Traditional) zh-Hant
I am using build.phonegap to build my both apps so I cannot modify the platform code but instead it has to be from either some config on config.xml or using cordova hooks or any other solution. So far I found solution for android using hooks but it will not work for iOS.
Thanks
For iOS you can do code in config.xml file.
<platform name="ios">
<edit-config target="CFBundleLocalizations" file="*-Info.plist" mode="overwrite">
<array>
<string>en</string>
<string>es</string>
</array>
</edit-config>
</platform>
Usage of <edit-config> in config.xml was introduced in Cordova 6.4.0.

plugin plugin.google.maps using phonegap build service doesnt work on ios

i have a small project using the plugin plugin.google.maps (https://github.com/wf9a5m75/phonegap-googlemaps-plugin) .
Also, i use phonegap buid service, not CLI.
In config.xml file i have the code
<gap:plugin name="plugin.google.maps" source="plugins.cordova.io" version="~1.2.4">
<param name="API_KEY_FOR_ANDROID" value="xxx" />
<param name="API_KEY_FOR_IOS" value="xxx" />
</gap:plugin>
Android apk's works like a charm, but on ios device i get the message
"Api key is not setted.
Please replace 'API_KEY_FOR_IOS' in the platforms/ios/.../...Info.plist with your API key."
Does anyone have a clue how i can solve this using the phonegap build service?
Despite the fact that this was supposed to work
(https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/411#issuecomment-75452290)
after a couple of days in a nutshell i figured that i had to override the instructions for ios property list for the plist key "Google Maps API Key".
So, in config.xml i inserted the code:
<gap:config-file platform="ios" parent="Google Maps API Key" mode="replace">
<string>xxx</string>
</gap:config-file>
where xxx is the Google Maps API Key for iOS
http://docs.build.phonegap.com/en_US/configuring_config_file_element.md.html

How to remove Phonegap Build Permission alert in iOS?

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

Resources