### Notifee-Expo-Plugin # ######################################################################################################################################################
对 你们 寻找一个可以神奇地为您做这些事情的插件, 而不需要弹出您的 Expo 应用程序
- 在 Notifee 服务中添加通知服务扩展 (由于iOS上的低功率模式使得BackgroundEvent上的 Notifee 无法使用)
- 用您提供的 Apple dev 团队 ID 自动签名您的主要应用程序和通知服务扩展目标
- 在您的应用程序中添加 iOS 通信通知功能
- 启用您喜欢的 iOS 背景模式
- 用您的通知图标插入您的 Android 应用程序文件夹
你来对地方了!
* 安装 * * *
确定你已经有了 @notifee/react-native 安装,然后:
# npm
npm install @evennit/notifee-expo-plugin
#or
# yarn
yarn add @evennit/notifee-expo-plugin
翻译:
将插件添加到您的 Expo 配置的插件阵列中 :
应用配置.js
{
plugins: [
[
"@evennit/notifee-expo-plugin",
{
iosDeploymentTarget: "13.4", //<-- Must be the same as your main app target's iOS deployment target
apsEnvMode: "development",
},
],
];
}
应用. config.json
{
"expo": {
"plugins": [
[
"@evennit/notifee-expo-plugin",
{
"iosDeploymentTarget": "13.4", //<-- Must be the same as your main app target's iOS deployment target
"apsEnvMode": "development"
}
]
]
}
}
重建你的应用程序
在安装并添加插件到您的工程的 Expo 配置插件阵列后, 您需要重建您的 iOS 和 Android 应用程序 :
npx expo prebuild
现在你该走了!
道具
| 财产 | 说明 |
|---|---|
apsEnvMode: string (必须) | 设置 APS 环境权限 。 确定是使用开发还是生产Apple Push通知服务(APN). 数值 : "development" 或者说 "production" |
iosDeploymentTarget: string (必须) | 为iOS设定通知服务扩展的部署目标. 这应该符合主应用程序的部署目标. 实例: "13.4" |
androidIcons?: NotifeeAndroidIcon[] | 指定将添加到适当的资源文件夹中的Android图标,以备通知。 每个图标应使用名称、路径和类型(大小)来定义. 实例: [{ name: "ic_small_logo", path: "./assets/logo.png", type: "small" }] |
enableCommunicationNotifications?: boolean | 启用通信通知, 这将添加通信通知的必要配置 https://github.com/invertase/notifee/pull/526 (英语)。 。 。 . |
appleDevTeamId?: string | 用提供的苹果开发团队ID自动在app和通知服务扩展目标上签名. |
customNotificationServiceFilePath?: string | 指定自定义通知服务文件的路径,其中应该已经包括 Notifee 的必要配置以及任何额外的定制。 您可以基于此软件包的默认通知Service.m文件. 实例: "./assets/notifee/NotificationService.m"。 。 。 . |
backgroundModes?: string[] | 指定应用程序的背景模式。 如果不提供,默认值将是: ["remote-notification"]另一方面,一个空阵列 [] 将会向插件发出信号以跳过背景 Modes 步骤 。 仅iOS.在此参见可能值 : https://developer.apple.com/documentation/bundleresources/information property list/uibackgroundmodes 页面存档备份,存于互联网档案馆 |
verbose?: boolean | 在插件配置过程中启用动词日志输出. 设定为 true,插件将记录每个步骤的详细信息。 默认为 false。 。 。 . |
STARS队
如果这对你有什么用,就给它一个:
感谢并想支持我
你可以支持我 通过 科非语。 。 。 .
执照
这套软件包可在 麻省理工学院许可证。 。 。 .
快乐的编码 :)