[SOLVED] Cordova iOS Quirks....wait what?!?

Cordova introduced some changes in the usage descriptions with their last releases (see http://cordova.apache.org/news/2017/11/10/plugins-release.html)

We have also changed how usage descriptions work in the following plugins: cordova-plugin-camera, cordova-plugin-contacts, cordova-plugin-media, cordova-plugin-geolocation, and cordova-plugin-media-capture. Usage descriptions are required for iOS applications accessing certain apis. Apple wants to know why your app needs certain permissions. We now recommend you add the usage description to your app via edit-config tag. View the iOS Quirks section of the plugin documentation to see an example of how to use it. Here is the example for cordova-plugin-camera.

For example https://github.com/apache/cordova-plugin-camera#ios-quirks

iOS Quirks

Since iOS 10 it’s mandatory to provide an usage description in the info.plist if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn’t provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don’t provide an usage description.

  1. Does that mean that my current app in store is currently freaky crashing on most devices or is that just a warning for upgrade, meaning that from now on I should not forget to provide a description?

  2. It’s me or they forget the internationalization respectively it’s only possible to provide one sting aka one language for the description?

Before it was done one way, with the new verions of the plugins it is done in another way (edit-config).

This is indeed an unsolved problem with Cordova I think. You might want to open an issue at issues.cordova.io about that and see what you get as an answer. (Thought about that myself a few times, but never enough to go ahead and open that issue)

(Not a new problem, always was the case by the way)

Glad you confirm my thought, thx

I will open an issue for the internationalization, you know, multiple languages, specially in Switzerland, always a concern :wink:

Here you go https://issues.apache.org/jira/browse/CB-13575

1 Like

@Sujan12 hey you know what, just noticed now, with previous version of cordova plugins geolocation or camera, the msg wasn’t internationalized neither, don’t know why I thought i was, I probably never paid enough attention I guess

for example with cordova-plugin-geolocation 2.4.3 it sais (phone in German):

Darf “meine App” auf deinen Standort zugreifen, wenn du die App verwendest?
This app requires access to your location when the screen is on and the app is displayed.
Nicht erlauben

“meine App” möchte auf deine Kamera zugreifen
This app requires camera access to function properly.
Nicht erlauben

You probably knew it but for me it’s almost a mind blowing LOL


So it means, I could upgrade, don’t have to wait for the improvements, since it’s not gonna be a regression :wink:

Oh yes, I thought that was clear :wink:

But this is a general “defect” for Cordova plugins then that should get a solution as you suggested.

1 Like

For the record, cordova doesn’t support yet internationalization, therefore they could not yet implement it, for that reason, the issue was close. In the future, once internationalization implemented, something in that direction may comes. Task was set as not fixed https://issues.apache.org/jira/browse/CB-13575

As workaround they propose to write my/your own hooks in the meantime

Do you have a nice template for a good hook to use here?

Not yet at least, I’ve also move this task in my minor priority list

1 Like

iam using ionic cordova contacts plugin ,it was working fine in android ,but in ios app is going to crashed