12

I am integrating Freshdesk in react native using the instructions in the link below:

https://support.freshchat.com/support/solutions/articles/50000000467-freshchat-react-native-sdk-integration-steps

After I finished the steps, I'm getting the error:

Missing/Bad FileProvider for Freshchat. Camera capture will fail in devices running Nougat or later versions of OS (error code 354)

Any ideas? Thanks.

I'm using react native 0.61.4

Octavio
  • 171
  • 1
  • 5

4 Answers4

5

AndroidManifest.xml

try changing android:name="android.support.v4.content.FileProvider" to android:name="androidx.core.content.FileProvider"

<application>

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="com.mypackage.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/freshchat_file_provider_paths" />
</provider>
</application>

values/strings.xml

<string name="freshchat_file_provider_authority">com.mypackage.provider</string>

Ref

Muhammad Numan
  • 23,222
  • 6
  • 63
  • 80
0

Please refer to this solution, it will help you to resolve this issue.

var freshchatConfig = new FreshchatConfig(APP_ID, APP_KEY); 
freshchatConfig.cameraCaptureEnabled = false;

Use false instead of true.

Alpi Murányi
  • 1,117
  • 10
  • 17
0

I was facing the same issue and I found that another app is using the same "android:authorities" I had for freshchat provider.

To solve this just give "android:authorities" a unique name and make sure it's not used by another app.

E.g.: Your app name is called: APPX ... Change your android:authorities to com.mypackage.provider.APPX

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.mypackage.provider.APPX"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/freshchat_file_provider_paths" /> </provider>
0

You can simply make cameraCaptureEnabled property false like so:

const freshchatConfig = new FreshchatConfig(
YOUR_CHAT_APP_ID,
YOUR_APP_KEY,
);

freshchatConfig.domain = YOUR_DOMAIN;
freshchatConfig.cameraCaptureEnabled = false;

This solve the issue for me.

Hamza Hmem
  • 502
  • 5
  • 11