[Barcode Scanner Plugin] How to change the permission message?

Forge Component
(10)
Published on 2018-11-14 by Leonardo Fernandes
10 votes
Published on 2018-11-14 by Leonardo Fernandes

Hello everyone!!!


I'm trying to change the message that appear to the users when they are ask to permite the access to your camera device.


I alredy tryed to add a variable at the Extensibily Configurations like:


{
    "plugin":
    {
        "url": "https://github.com/phonegap/phonegap-plugin-barcodescanner.git#v8.0.0",
        "variables": [{
            "name": "ANDROID_SUPPORT_V4_VERSION",
            "value": "26.+"
        },
        {
            "name": "NS_CAMERA_USAGE_DESCRIPTION",
            "value": "Sua câmera é utilizada para leitura de Códigos de Barras e QRCodes."
        }]
    }
}


or


{
    "plugin":
    {
        "url": "https://github.com/phonegap/phonegap-plugin-barcodescanner.git#v8.0.0",
        "variables": [{
            "name": "ANDROID_SUPPORT_V4_VERSION",
            "value": "26.+"
        },
        {
            "name": "CAMERA_USAGE_DESCRIPTION",
            "value": "Sua câmera é utilizada para leitura de Códigos de Barras e QRCodes."
        }]
    }
}


But the message that appers remais "We access your camera to take pictures" like screenshot:



Can someone help me to change this message?

Hi Pedro,

Should you not be using the variable name "NSCameraUsageDescription" as mentioned on below link? https://github.com/phonegap/phonegap-plugin-barcodescanner

Junaid Ahmed Syed wrote:

Hi Pedro,

Should you not be using the variable name "NSCameraUsageDescription" as mentioned on below link? https://github.com/phonegap/phonegap-plugin-barcodescanner


Hello Junaid,

I already tried to do it too... and the problem remains!
I also updated the plugin version to the latest...

 

Solution

@pedro 

if you check this plugin https://github.com/phonegap/phonegap-plugin-barcodescanner in repositry you will not be able to find  CAMERA_USAGE_DESCRIPTION variable for ANDROID but for  IOS , it is there as NSCameraUsageDescription

Note :  iOS 10 it's mandatory to add a NSCameraUsageDescription

If you check ,there is no such variable mentioned in Extensibily Configurations .

{
    "plugin":
    {
        "url": "https://github.com/phonegap/phonegap-plugin-barcodescanner.git#v8.0.0",
        "variables": [{
            "name": "ANDROID_SUPPORT_V4_VERSION",
            "value": "26.+"
        }]
    }
}

So there is no option to configure a message ,which is for asking a camera permission.

Last option is to create your own custom plugin and push to github and create your own extension using that.

For any help or suggestion  feel free to ask.

 

Solution

Vivek Patel wrote:

@pedro 

if you check this plugin https://github.com/phonegap/phonegap-plugin-barcodescanner in repositry you will not be able to find  CAMERA_USAGE_DESCRIPTION variable for ANDROID but for  IOS , it is there as NSCameraUsageDescription

Note :  iOS 10 it's mandatory to add a NSCameraUsageDescription

If you check ,there is no such variable mentioned in Extensibily Configurations .

{
    "plugin":
    {
        "url": "https://github.com/phonegap/phonegap-plugin-barcodescanner.git#v8.0.0",
        "variables": [{
            "name": "ANDROID_SUPPORT_V4_VERSION",
            "value": "26.+"
        }]
    }
}

So there is no option to configure a message ,which is for asking a camera permission.

Last option is to create your own custom plugin and push to github and create your own extension using that.

For any help or suggestion  feel free to ask.

 

Thanks Vivek!