我正在使用以下链接中的说明将 Freshdesk 集成到 react native 中:
完成这些步骤后,我收到错误消息:
Missing/Bad FileProvider for Freshchat. Camera capture will fail in devices running Nougat or later versions of OS (error code 354)
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?谢谢。
我正在使用本机 0.61.4
我安装了 @react-native-firebase v6,它按预期工作,但是当我尝试运行单元测试时,出现以下错误:
Jest encountered an unexpected token
Details:
/node_modules/@react-native-firebase/database/lib/index.js:18
import { isBoolean, isNumber, isString } from '@react-native-firebase/app/lib/common';
^
SyntaxError: Unexpected token {
Run Code Online (Sandbox Code Playgroud)
我尝试将 @react-native-firebase/database 和 @react-native-firebase/app 添加到 jest config TransformIgnorePatterns 并收到以下错误:
Test suite failed to run
Invariant Violation: Native module cannot be null.
at invariant (node_modules/invariant/invariant.js:40:15)
at RNFBNativeEventEmitter.NativeEventEmitter (node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js:36:7)
at new RNFBNativeEventEmitter (node_modules/@react-native-firebase/app/lib/internal/RNFBNativeEventEmitter.js:24:5)
at Object.<anonymous> (node_modules/@react-native-firebase/app/lib/internal/RNFBNativeEventEmitter.js:48:16)
at Object.<anonymous> (node_modules/@react-native-firebase/app/lib/internal/registry/nativeModule.js:21:1)
Run Code Online (Sandbox Code Playgroud)
我还尝试用 Jest 模拟模块,如下所示:
import * as FBCommon from '@react-native-firebase/app/lib/common'
jest.mock(FBCommon, () => {
return () => ({
isBoolean: jest.fn(),
isNumber: …Run Code Online (Sandbox Code Playgroud)