{"id":20732415,"url":"https://github.com/jpush/jmlink-react-native","last_synced_at":"2025-04-23T22:09:01.283Z","repository":{"id":40766227,"uuid":"268756614","full_name":"jpush/jmlink-react-native","owner":"jpush","description":"JMlink's officially supported react native plugin (Android \u0026 iOS).  极光魔链官方支持的 react native 插件（Android \u0026 iOS）。","archived":false,"fork":false,"pushed_at":"2023-01-06T07:41:24.000Z","size":9061,"stargazers_count":2,"open_issues_count":16,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T22:08:03.737Z","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/jpush.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}},"created_at":"2020-06-02T09:23:02.000Z","updated_at":"2021-07-22T17:47:53.000Z","dependencies_parsed_at":"2023-02-05T15:46:11.656Z","dependency_job_id":null,"html_url":"https://github.com/jpush/jmlink-react-native","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjmlink-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjmlink-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjmlink-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjmlink-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpush","download_url":"https://codeload.github.com/jpush/jmlink-react-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522299,"owners_count":21444511,"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":"2024-11-17T05:19:21.612Z","updated_at":"2025-04-23T22:09:01.201Z","avatar_url":"https://github.com/jpush.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JMLink-React-Native\n\n## ChangeLog\n\n### v 1.2.0\n\n极光魔链RN  1.2.4\n\n### v 1.0.0\n\n极光魔链RN第一版\n\n## 1. 安装\n\n```\nnpm install jmlink-react-native --save\n```\n\n* 注意：如果项目里没有jcore-react-native，需要安装\n\n  ```\n  npm install jcore-react-native --save\n  ```\n\n## 2. 配置\n\n### 2.1 Android\n\n* build.gradle\n\n  ```\n  android {\n        defaultConfig {\n            applicationId \"yourApplicationId\"           //在此替换你的应用包名\n            ...\n            manifestPlaceholders = [\n                    JPUSH_APPKEY: \"yourAppKey\",         //在此替换你的APPKey\n                    JPUSH_CHANNEL: \"yourChannel\",       //在此替换你的channel\n                    JMLINK_SCHEME: \"yourScheme\"  // 在此替换你的scheme\n            ]\n        }\n    }\n  ```\n\n  ```\n  dependencies {\n        ...\n        implementation project(':jmlink-react-native') // 添加 jverification 依赖\n        implementation project(':jcore-react-native')         // 添加 jcore 依赖\n    }\n  ```\n\n* setting.gradle\n\n  ```\n  include ':jmlink-react-native'\n  project(':jmlink-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jmlink-react-native/android')\n  include ':jcore-react-native'\n  project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android')\n  ```\n\n### 2.2 iOS\n\n### 2.2.1 pod\n\n```\npod install\n```\n\n* 注意：如果项目里使用pod安装过，请先执行命令\n\n  ```\n  pod deintegrate\n  ```\n\n### 2.2.2 手动方式\n\n* Libraries\n\n  ```\n  Add Files to \"your project name\"\n  node_modules/jcore-react-native/ios/RCTJCoreModule.xcodeproj\n  node_modules/jmlink-react-native/ios/RCTJMLinkModule.xcodeproj\n  ```\n\n* Build Settings\n\n  ```\n  All --- Search Paths --- Header Search Paths --- +\n  $(SRCROOT)/../node_modules/jcore-react-native/ios/RCTJCoreModule/\n  $(SRCROOT)/../node_modules/jmlink-react-native/ios/RCTJMLinkModule/\n  ```\n\n* Build Phases\n\n  ```\n  libz.tbd\n  libc++.1.tbd\n  libresolv.tbd\n  libsqlite3.tbd\n  libRCTJCoreModule.a\n  libRCTJMLinkModule.a\n  ```\n\n* info.plist\n\n  ```\n  View controller-based status bar appearance : YES\n  ```\n### 2.2.3 配置\n\n+ 配置App的URL Scheme\n\n\u003e iOS系统中App之间是相互隔离的，通过URL Scheme，App之间可以相互调用，并且可以传递参数。\n\u003e 选中`Target-\u003eInfo-\u003eURL Types`，配置URL Scheme（比如：jmlink）\n\u003e\n\u003e 在Safari中输入`URL Scheme://`（比如：`jmlink://`）如果可以唤起App，说明该URL Scheme配置成功。\n\n+ 配置Universal link\n\n\u003e Universal link是iOS9的一个新特性，通过Universal link，App可以无需打开Safari，直接从微信等应用中跳转到App，真正的实现一键直达。如果使用URL Scheme的话，需要先打开Safari，用户体验变得很差，如果App未安装，还会出现以下错误对话框\n\nXcode 里的具体配置请查看 [mLink的设置](https://docs.jiguang.cn/jmlink/client/iOS/ios_guide/)\n\n+ 初始化代码\n\n\t在 iOS 项目的 AppDelegate.m 文件内的 [application: didFinishLaunchingWithOptions:] 方法里必须调用如下代码完成初始化\n\n```\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {  \n  \t[RCTJMLinkModule setupAppKey:@\"极光官网分配的appKey\"\n                       channel:@\"channel\"\n                 advertisingId:nil\n                  isProduction:NO\n                       isDebug:YES]; \n  }\n```\n\n## 3. 引用\n\n参考：[App.js](https://github.com/jpush/jmlink-react-native/tree/master/example/App.js)\n\n## 4. API\n\n详见：[index.js](https://github.com/jpush/jmlink-react-native/tree/master/plugin/index.js)\n\n## 5.  其他\n\n* 集成前务必将example工程跑通\n* 上报问题还麻烦先将init参数中params的debug字段设置成true，拿到debug日志  \n\n \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjmlink-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpush%2Fjmlink-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjmlink-react-native/lists"}