Setting NSCameraUsageDescription programmatically?
I have a requirement to display a different camera permissions message, one for when the user starts the QR scanner, and one for taking a photo.
The user can start with either one, and product don't want to use a generic message for both.
Is there a way to set NSCameraUsageDescription programmatically, or can this only be done within Info.plist?
Thanks
ios swift
add a comment |
I have a requirement to display a different camera permissions message, one for when the user starts the QR scanner, and one for taking a photo.
The user can start with either one, and product don't want to use a generic message for both.
Is there a way to set NSCameraUsageDescription programmatically, or can this only be done within Info.plist?
Thanks
ios swift
add a comment |
I have a requirement to display a different camera permissions message, one for when the user starts the QR scanner, and one for taking a photo.
The user can start with either one, and product don't want to use a generic message for both.
Is there a way to set NSCameraUsageDescription programmatically, or can this only be done within Info.plist?
Thanks
ios swift
I have a requirement to display a different camera permissions message, one for when the user starts the QR scanner, and one for taking a photo.
The user can start with either one, and product don't want to use a generic message for both.
Is there a way to set NSCameraUsageDescription programmatically, or can this only be done within Info.plist?
Thanks
ios swift
ios swift
edited Nov 22 '18 at 9:18
wvteijlingen
8,23112544
8,23112544
asked Nov 22 '18 at 9:06
thedpthedp
3,530144278
3,530144278
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
You can't edit the Info.plist of your app. You don't have write access to that file. In fact an app's bundle is read-only. You can't save changes to your bundle.
You should use a generic message mentioning both cases in the permission message. This way user knows that this permission will also be utilised in other places too.
add a comment |
As pointed out, .plist files cannot be edited at runtime. Anyways they can be localized. It's possible to create multiple Localizable.strings files containing different values for your NSCameraUsageDescription.
Right after, you could change the localization file your app is pointing to, obtaining the correct text that will be displayed in the alert.
I doubt if apple approves this :(
– Aakash
Nov 22 '18 at 9:44
Replacing localization strings at runtime is something that lots of applications do and there's nothing in the Developer Agreements that state such thing. That would be a totally viable approach :)
– Lorenzo Zanotto
Nov 22 '18 at 10:02
@LorenzoZanotto can you explain how to replace a localized InfoPlist.string my app is pointing to? thanks
– thedp
Nov 22 '18 at 10:06
I am concerned about apple and may be some users too might find out by doing this we are hiding out what our apps will exactly do with a permission. BTW I am also curious too know if this is feasible just for knowledge :)
– Aakash
Nov 22 '18 at 10:11
@thedp you can take a look here, it explains how to change the bundle you're reading from stackoverflow.com/questions/49649199/…
– Lorenzo Zanotto
Nov 22 '18 at 10:17
|
show 1 more comment
Besides the general message, you may present your customized alert message before request authorization somewhere, even with cooling animations.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53427266%2fsetting-nscamerausagedescription-programmatically%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can't edit the Info.plist of your app. You don't have write access to that file. In fact an app's bundle is read-only. You can't save changes to your bundle.
You should use a generic message mentioning both cases in the permission message. This way user knows that this permission will also be utilised in other places too.
add a comment |
You can't edit the Info.plist of your app. You don't have write access to that file. In fact an app's bundle is read-only. You can't save changes to your bundle.
You should use a generic message mentioning both cases in the permission message. This way user knows that this permission will also be utilised in other places too.
add a comment |
You can't edit the Info.plist of your app. You don't have write access to that file. In fact an app's bundle is read-only. You can't save changes to your bundle.
You should use a generic message mentioning both cases in the permission message. This way user knows that this permission will also be utilised in other places too.
You can't edit the Info.plist of your app. You don't have write access to that file. In fact an app's bundle is read-only. You can't save changes to your bundle.
You should use a generic message mentioning both cases in the permission message. This way user knows that this permission will also be utilised in other places too.
edited Nov 22 '18 at 9:14
thedp
3,530144278
3,530144278
answered Nov 22 '18 at 9:10
AakashAakash
1,343715
1,343715
add a comment |
add a comment |
As pointed out, .plist files cannot be edited at runtime. Anyways they can be localized. It's possible to create multiple Localizable.strings files containing different values for your NSCameraUsageDescription.
Right after, you could change the localization file your app is pointing to, obtaining the correct text that will be displayed in the alert.
I doubt if apple approves this :(
– Aakash
Nov 22 '18 at 9:44
Replacing localization strings at runtime is something that lots of applications do and there's nothing in the Developer Agreements that state such thing. That would be a totally viable approach :)
– Lorenzo Zanotto
Nov 22 '18 at 10:02
@LorenzoZanotto can you explain how to replace a localized InfoPlist.string my app is pointing to? thanks
– thedp
Nov 22 '18 at 10:06
I am concerned about apple and may be some users too might find out by doing this we are hiding out what our apps will exactly do with a permission. BTW I am also curious too know if this is feasible just for knowledge :)
– Aakash
Nov 22 '18 at 10:11
@thedp you can take a look here, it explains how to change the bundle you're reading from stackoverflow.com/questions/49649199/…
– Lorenzo Zanotto
Nov 22 '18 at 10:17
|
show 1 more comment
As pointed out, .plist files cannot be edited at runtime. Anyways they can be localized. It's possible to create multiple Localizable.strings files containing different values for your NSCameraUsageDescription.
Right after, you could change the localization file your app is pointing to, obtaining the correct text that will be displayed in the alert.
I doubt if apple approves this :(
– Aakash
Nov 22 '18 at 9:44
Replacing localization strings at runtime is something that lots of applications do and there's nothing in the Developer Agreements that state such thing. That would be a totally viable approach :)
– Lorenzo Zanotto
Nov 22 '18 at 10:02
@LorenzoZanotto can you explain how to replace a localized InfoPlist.string my app is pointing to? thanks
– thedp
Nov 22 '18 at 10:06
I am concerned about apple and may be some users too might find out by doing this we are hiding out what our apps will exactly do with a permission. BTW I am also curious too know if this is feasible just for knowledge :)
– Aakash
Nov 22 '18 at 10:11
@thedp you can take a look here, it explains how to change the bundle you're reading from stackoverflow.com/questions/49649199/…
– Lorenzo Zanotto
Nov 22 '18 at 10:17
|
show 1 more comment
As pointed out, .plist files cannot be edited at runtime. Anyways they can be localized. It's possible to create multiple Localizable.strings files containing different values for your NSCameraUsageDescription.
Right after, you could change the localization file your app is pointing to, obtaining the correct text that will be displayed in the alert.
As pointed out, .plist files cannot be edited at runtime. Anyways they can be localized. It's possible to create multiple Localizable.strings files containing different values for your NSCameraUsageDescription.
Right after, you could change the localization file your app is pointing to, obtaining the correct text that will be displayed in the alert.
answered Nov 22 '18 at 9:35
Lorenzo ZanottoLorenzo Zanotto
1365
1365
I doubt if apple approves this :(
– Aakash
Nov 22 '18 at 9:44
Replacing localization strings at runtime is something that lots of applications do and there's nothing in the Developer Agreements that state such thing. That would be a totally viable approach :)
– Lorenzo Zanotto
Nov 22 '18 at 10:02
@LorenzoZanotto can you explain how to replace a localized InfoPlist.string my app is pointing to? thanks
– thedp
Nov 22 '18 at 10:06
I am concerned about apple and may be some users too might find out by doing this we are hiding out what our apps will exactly do with a permission. BTW I am also curious too know if this is feasible just for knowledge :)
– Aakash
Nov 22 '18 at 10:11
@thedp you can take a look here, it explains how to change the bundle you're reading from stackoverflow.com/questions/49649199/…
– Lorenzo Zanotto
Nov 22 '18 at 10:17
|
show 1 more comment
I doubt if apple approves this :(
– Aakash
Nov 22 '18 at 9:44
Replacing localization strings at runtime is something that lots of applications do and there's nothing in the Developer Agreements that state such thing. That would be a totally viable approach :)
– Lorenzo Zanotto
Nov 22 '18 at 10:02
@LorenzoZanotto can you explain how to replace a localized InfoPlist.string my app is pointing to? thanks
– thedp
Nov 22 '18 at 10:06
I am concerned about apple and may be some users too might find out by doing this we are hiding out what our apps will exactly do with a permission. BTW I am also curious too know if this is feasible just for knowledge :)
– Aakash
Nov 22 '18 at 10:11
@thedp you can take a look here, it explains how to change the bundle you're reading from stackoverflow.com/questions/49649199/…
– Lorenzo Zanotto
Nov 22 '18 at 10:17
I doubt if apple approves this :(
– Aakash
Nov 22 '18 at 9:44
I doubt if apple approves this :(
– Aakash
Nov 22 '18 at 9:44
Replacing localization strings at runtime is something that lots of applications do and there's nothing in the Developer Agreements that state such thing. That would be a totally viable approach :)
– Lorenzo Zanotto
Nov 22 '18 at 10:02
Replacing localization strings at runtime is something that lots of applications do and there's nothing in the Developer Agreements that state such thing. That would be a totally viable approach :)
– Lorenzo Zanotto
Nov 22 '18 at 10:02
@LorenzoZanotto can you explain how to replace a localized InfoPlist.string my app is pointing to? thanks
– thedp
Nov 22 '18 at 10:06
@LorenzoZanotto can you explain how to replace a localized InfoPlist.string my app is pointing to? thanks
– thedp
Nov 22 '18 at 10:06
I am concerned about apple and may be some users too might find out by doing this we are hiding out what our apps will exactly do with a permission. BTW I am also curious too know if this is feasible just for knowledge :)
– Aakash
Nov 22 '18 at 10:11
I am concerned about apple and may be some users too might find out by doing this we are hiding out what our apps will exactly do with a permission. BTW I am also curious too know if this is feasible just for knowledge :)
– Aakash
Nov 22 '18 at 10:11
@thedp you can take a look here, it explains how to change the bundle you're reading from stackoverflow.com/questions/49649199/…
– Lorenzo Zanotto
Nov 22 '18 at 10:17
@thedp you can take a look here, it explains how to change the bundle you're reading from stackoverflow.com/questions/49649199/…
– Lorenzo Zanotto
Nov 22 '18 at 10:17
|
show 1 more comment
Besides the general message, you may present your customized alert message before request authorization somewhere, even with cooling animations.
add a comment |
Besides the general message, you may present your customized alert message before request authorization somewhere, even with cooling animations.
add a comment |
Besides the general message, you may present your customized alert message before request authorization somewhere, even with cooling animations.
Besides the general message, you may present your customized alert message before request authorization somewhere, even with cooling animations.
answered Nov 22 '18 at 13:11
E.ComsE.Coms
2,1222414
2,1222414
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53427266%2fsetting-nscamerausagedescription-programmatically%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown