Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Freshchat for react native bad file provider error

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

like image 831
Octavio Avatar asked Feb 14 '20 23:02

Octavio


Video Answer


2 Answers

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

like image 104
Muhammad Numan Avatar answered Oct 06 '22 00:10

Muhammad Numan


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.

like image 39
umesh kumar Avatar answered Oct 06 '22 00:10

umesh kumar