{"id":26647211,"url":"https://github.com/devengagelab/engagelab-uts-plugin","last_synced_at":"2025-03-24T23:51:24.111Z","repository":{"id":279929916,"uuid":"940342141","full_name":"DevEngageLab/engagelab-uts-plugin","owner":"DevEngageLab","description":"engagelab push sdk uts plugin","archived":false,"fork":false,"pushed_at":"2025-02-28T08:50:37.000Z","size":2319,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T15:30:24.239Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevEngageLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-28T02:27:56.000Z","updated_at":"2025-02-28T08:50:40.000Z","dependencies_parsed_at":"2025-02-28T15:30:52.062Z","dependency_job_id":"d0d75f96-ecc7-4af7-ab84-7cf33a4eb7d0","html_url":"https://github.com/DevEngageLab/engagelab-uts-plugin","commit_stats":null,"previous_names":["devengagelab/engagelab-uts-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fengagelab-uts-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fengagelab-uts-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fengagelab-uts-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevEngageLab%2Fengagelab-uts-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevEngageLab","download_url":"https://codeload.github.com/DevEngageLab/engagelab-uts-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245372366,"owners_count":20604490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-24T23:51:23.588Z","updated_at":"2025-03-24T23:51:24.080Z","avatar_url":"https://github.com/DevEngageLab.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uts-engagelabmtpush\n\n## 兼容性\n\n只支持 Android 和 iOS。\n\n最低支持 iOS12。\n\n## 插件市场地址\n\n## Demo\n[Github](https://github.com/DevEngageLab/engagelab-uts-plugin)\n\n## 接入\n\n- 3.在项目中引用插件\n```\nimport {  InitPushParams, initPush, setDebugMode, addEventCallBack, EventCallBack, EventCallBackParams, setBadge, SetBadge, getRegistrationId } from \"@/uni_modules/engagelab-mtpush\"\n```\n\n## Android 配置 应用的 nativeResources/android 目录下新增 manifestPlaceholders.json 文件。 内容参考如下，根据自身项目填入正确的值。\n\n```js\n{\n    \"ENGAGELAB_PRIVATES_APPKEY\" : \"xxx\",\n    \"ENGAGELAB_PRIVATES_CHANNEL\": \"xxx\",\n    \"ENGAGELAB_PRIVATES_PROCESS\": \":remote\",\n\t\"XIAOMI_APPID\" : \"MI-xxx\",\n\t\"XIAOMI_APPKEY\" : \"MI-xxx\",\n\t\"MEIZU_APPID\" : \"MZ-xxx\",\n\t\"MEIZU_APPKEY\" : \"MZ-xxx\",\n\t\"OPPO_APPID\" :  \"OP-xxx\",\n\t\"OPPO_APPKEY\" : \"OP-xxx\",\n\t\"OPPO_APPSECRET\" : \"OP-xxx\",\n\t\"VIVO_APPID\":  \"xxx\",\n\t\"VIVO_APPKEY\" : \"xxx\",\n\t\"HONOR_APPID\" : \"xxx\"\n}\n```\n\n如果支持谷歌通道，在应用的 nativeResources/android 目录下，放入 google-services.json 文件。\n如果支持华为通道，在应用的 nativeResources/android 目录下，放入 agconnect-services.json 文件。\n\n#### Android 厂商配置说明\n插件支持 OPPO VIVO 魅族 小米 华为 FCM 荣耀七大厂商推送接入，如需接入请对应配置上述厂商信息。\n\n- [厂商通道参数申请指南](https://jiguang-docs.yuque.com/staff-mg3p4r/vc4ysl/ca9ssa1c4izt4b5u?singleDoc#)\n\n## 参考资料\n[官方文档](https://www.engagelab.com/push)\n\n\n# API 说明\n\n## 注册监听\n\n### addEventCallBack(param: EventCallBackParams) : void （android/ios都支持）\n\n集成了 sdk 回调的事件\n\n#### 参数说明\n- param:返回的事件数据\n  - param[\"event_name\"]: 为事件类型\n    - android:\n      - \"onNotificationStatus\":应用通知开关状态回调,Map格式。enable属性：true为打开，false为关闭\n      - \"onConnectStatus\":长连接状态回调, Map格式。enable属性：true为打开，false为关闭\n      - \"onNotificationArrived\":通知消息到达回调，内容为通知消息体\n      - \"onNotificationClicked\":通知消息点击回调，内容为通知消息体\n      - \"onNotificationDeleted\":通知消息删除回调，内容为通知消息体\n      - \"onCustomMessage\":自定义消息回调，内容为通知消息体\n      - \"onPlatformToken\":厂商token消息回调，内容为厂商token消息体\n      - \"onTagMessage\":tag操作回调 //todo\n      - \"onAliasMessage\":alias操作回调\n      - \"onNotificationUnShow\":在前台，通知消息不显示回调（后台下发的通知是前台信息时）\n      - \"onInAppMessageShow\": 应用内消息展示\n      - \"onInAppMessageClick\": 应用内消息点击\n    - ios:\n\t  - \"onNotificationStatus\":检测通知权限授权情况。Map格式。enable属性：true为打开，false为关闭。需要先调用getNotiAuth() 接口。\n\t  - \"onConnectStatus\":长连接状态回调, Map格式。enable属性：true为打开，false为关闭 \n      - \"onNotificationArrived\":通知消息到达回调，内容为通知消息体（同原生平台willPresentNotification回调）\n      - \"onNotificationClicked\":通知消息点击回调，内容为通知消息体\n      - \"onCustomMessage\":自定义消息回调，内容为通知消息体\n      - \"onTagMessage\":tag操作回调 //todo\n      - \"onAliasMessage\":alias操作回调\n      - \"onInAppMessageShow\": 应用内消息展示\n      - \"onInAppMessageClick\": 应用内消息点击\n      - \"onNotiInMessageShow\": 增强提醒展示\n      - \"onNotiInMessageClick\": 增强提醒点击\n  - param[\"event_data\"]: 为对应内容，Map格式\n\n\n#### 代码示例\n\n```js\n\nlet eventCallBack = {\n\tcallback: (res: EventCallBack) =\u003e {\n\t\tconsole.log(res);\n\t}\n} as EventCallBackParams;\naddEventCallBack(eventCallBack);\n\n```\n\n\n## 初始化\n\n### initPush(param: InitPushParams) （ios/android）\n\n初始化sdk\n\n#### 接口定义\n\n```js\n  function initPush(param: InitPushParams): void\n```\n\n#### 代码示例\n```js\n// appkey对iOS生效，安卓的appkey需要配置在应用的 nativeResources/android/manifestPlaceholders.json中\nlet options = {\n\tappkey: '您的appkey',\n\tchannel: 'test',\n\tisProduction: false\n} as InitPushParams;\ninitPush(options);\n```\n\n\n## 开启 Debug 模式\n\n### setDebugMode(param: boolean) （android/ios都支持）\n\n设置是否debug模式，debug模式会打印更对详细日志\n\n#### 接口定义\n\n```js\nfunction setDebugMode(paramA : boolean) : void\n```\n\n#### 参数说明\n\n- param: 是否调试模式，true为调试模式，false不是\n\n#### 代码示例\n\n```js\nsetDebugMode(true);//发布前要删除掉\n```\n\n## 获取 RegistrationID （android/ios都支持）\n\n### function getRegistrationId(): string\n\nRegistrationID 定义:\n获取当前设备的registrationId，Engagelab唯一标识，可同于推送\n\n#### 接口定义\n\n```js\nfunction getRegistrationId(): string\n```\n\n#### 返回值\n\n调用此 API 来取得应用程序对应的 RegistrationID。 只有当应用程序成功注册到 MTPush 的服务器时才返回对应的值，否则返回空字符串。\n\n#### 代码示例\n\n```js\nconst rid = getRegistrationId();\n```\n\n## 设置应用角标数量 （android/ios都支持）\n\n### function setBadge(param: number) : void \n\nandroid: 仅华为/荣耀生效\n\n#### 接口定义\n\n```js\nfunction setBadge(param: number) : void \n```\n\n#### 返回值\n\n无\n\n#### 代码示例\n\n```js\n setBadge(2);\n```\n\n\n\n\n\n## 开启fcm测试模式\n\n### testConfigGoogle(enable: boolean) （仅android支持）\n\n设置为true, 可以在国内测试fcm通道，需要在初始化函数之前调用。\n\n该接口只用作测试，正式环境请不要调用该接口！！！\n\n#### 接口定义\n\n```js\nexport function testConfigGoogle(enable: boolean) : void \n```\n\n#### 参数说明\n\n- enable: 是否开启fcm调试模式，true为是，false不是\n\n#### 代码示例\n\n```js\ntestConfigGoogle(true);\n```\n\n## 检测通知授权情况\n\n### getNotiAuth() （仅iOS支持）\n\n调用该函数之前，请先调用 addEventCallBack(param: EventCallBackParams) : void 接口注册事件监听。\n\n回调 event_name 为 \"onNotificationStatus\" 事件。\n\n#### 接口定义\n\n```js\nexport function getNotiAuth() : void \n```\n\n#### 参数说明\n\n无\n\n#### 代码示例\n\n```js\ngetNotiAuth();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevengagelab%2Fengagelab-uts-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevengagelab%2Fengagelab-uts-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevengagelab%2Fengagelab-uts-plugin/lists"}