@fishjam-cloud/反应-本地客户
Fishjam的原始客户端库.
安装
npm install @fishjam-cloud/react-native-client
# or
yarn add @fishjam-cloud/react-native-client
Android VoIP 设置
对Android的呼叫通过Firebase Cloud Massaging传送 所以Firebase就是 只有在你选择加入时才进入你的建筑 iOS使用PushKit/APN,不需要这些.
博览
启用配置插件中的 VoIP , 并点出您的 Expo google-services.json数字 :
{
"expo": {
"android": { "googleServicesFile": "./google-services.json" },
"plugins": [["@fishjam-cloud/react-native-client", { "android": { "enableVoIP": true } }]]
}
}
其余的都是预建的. android.googleServicesFile
让博览会添加 com.google.gms:google-services 类路径,应用 Gradle 插件,并复制
文件输入 android/app/一边说一边 enableVoIP 正在运行是预建错误.
调用超时
插件可以设置本地超时秒 。 未回复的呼叫默认值 至 45 秒,未连接的调用默认为 60 秒 解答-实现握手默认为10秒:
{
"expo": {
"plugins": [
[
"@fishjam-cloud/react-native-client",
{
"android": { "enableVoIP": true },
"voip": {
"incomingCallTimeout": 45,
"outgoingCallTimeout": 60,
"fulfillAnswerCallTimeout": 10
}
}
]
]
}
}
所有超时属性都是可选的,必须是正限数. 说吧 属性以使用其本地默认值.
裸体反应原生
配置插件不运行,则 google-services 牵引插件
必须适用于 应用程序 模块 —— 库不能为您服务。 跟着
Firebase Android 设置指南 应添加
google-services.json 并应用插件.
您还必须用手表声明配置插件会注入什么
AndroidManifest.xml - 那个 MANAGE_OWN_CALLS, (中文(简体) ), POST_NOTIFICATIONS, (中文(简体) ),
USE_FULL_SCREEN_INTENT 财务报告和审定财务报表 VIBRATE 权限 IncomingCallActivity, (中文(简体) ),
页:1 EndCallNotificationReceiver,则 PushNotificationService 联合国
com.google.firebase.MESSAGING_EVENT 意图过滤器。 见 plugin/src/withFishjamVoIPAndroid.ts
准确的条目.
使用赤裸反射原生时手动设定超时元数据 :
<application>
<meta-data android:name="VoIPIncomingCallTimeout" android:value="45" />
<meta-data android:name="VoIPOutgoingCallTimeout" android:value="60" />
<meta-data android:name="VoIPFulfillAnswerTimeout" android:value="10" />
</application>
对于iOS, 添加与数字相同的超时值 Info.plist 键 :
VoIPIncomingCallTimeout, (中文(简体) ), VoIPOutgoingCallTimeout,以及
VoIPFulfillAnswerTimeout。 。 。 .
用 WebRTC 叉进行本地开发
此软件包取决于 @fishjam-cloud/react-native-webrtc,叉线 react-native-webrtc叉子住在这里 其自己的 GitHub 重播 并作为一个 git 子模块包含在这个单相中 packages/react-native-webrtc/被编织成线条 不需要手动链接 .
设置
用子模块克隆寄存器 :
git clone --recurse-submodules https://github.com/fishjam-cloud/web-client-sdk.git
如果您已经克隆了没有 --recurse-submodules,从回波内部初始化子模块:
git submodule update --init --recursive
然后从 repo 根安装依赖性 :
yarn install
雅恩决定 @fishjam-cloud/react-native-webrtc 到工作区 packages/react-native-webrtc/,而React Industrial自動連接会通过同义软件包自动取取出原生iOS和Android代码.
发展 工作流量
| 更改类型 | 怎么办 |
|---|---|
| JS/TS 变化 以叉为单位 | 保存 ~ 大都会热重装自动 |
| 本地代码更改 (iOS/Android) (英语) | 保存 ~ 重建应用程序( E)yarn ios 或者说 yarn android(中文(简体) ) |
没有 pod install 或者说 yarn install 在本地代码更改后需要——只需重建应用程序.
更新子模块
子模块跟踪叉 master 树枝,但被固定在一个特定的承诺。 更新最新上游:
git submodule update --remote packages/react-native-webrtc
git add packages/react-native-webrtc
git commit -m "Bump react-native-webrtc submodule"
检查特定标签或承诺:
git -C packages/react-native-webrtc fetch
git -C packages/react-native-webrtc checkout <tag-or-sha>
git add packages/react-native-webrtc
git commit -m "Pin react-native-webrtc to <tag-or-sha>"
当子模块跨越一个版本边界时, 也会更新 peerDependencies.@fishjam-cloud/react-native-webrtc 此软件包中 package.json 因此,外部消费者看到正确的范围.
帮助更改叉
内部变化 packages/react-native-webrtc/ 属于叉子的,不是这个。 将他们推向上游:
cd packages/react-native-webrtc
git checkout -b your-feature-branch
# commit your changes
git push origin your-feature-branch
# open a PR against fishjam-cloud/fishjam-react-native-webrtc
一旦上游的PR被合并,就将子模块sha撞到这里(见上文"更新子模块").