{"id":20732396,"url":"https://github.com/jpush/jpush-weex-plugin","last_synced_at":"2025-04-23T22:08:25.503Z","repository":{"id":56916360,"uuid":"139529735","full_name":"jpush/jpush-weex-plugin","owner":"jpush","description":null,"archived":false,"fork":false,"pushed_at":"2019-08-23T11:03:31.000Z","size":33091,"stargazers_count":9,"open_issues_count":1,"forks_count":8,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-23T22:07:34.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-03T04:44:19.000Z","updated_at":"2023-12-06T15:07:34.000Z","dependencies_parsed_at":"2022-08-20T20:50:29.325Z","dependency_job_id":null,"html_url":"https://github.com/jpush/jpush-weex-plugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-weex-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-weex-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-weex-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpush%2Fjpush-weex-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpush","download_url":"https://codeload.github.com/jpush/jpush-weex-plugin/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:12.666Z","updated_at":"2025-04-23T22:08:25.421Z","avatar_url":"https://github.com/jpush.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jpush-weex-plugin\n\n## Install\n\n### iOS\n\n- 通过 Pod 安装\n\n```\n$ pod install JPushWeexPlugin --save\n```\n\n- 将 [./src/index.js](./src/index.js) 文件添加到自己的工程中。\n\n- 在 Appdelegate.m 中添加如下代码\n\n  ```objective-c\n  // 1. 添加头文件\n  #ifdef NSFoundationVersionNumber_iOS_9_x_Max\n  #import \u003cUserNotifications/UserNotifications.h\u003e\n  #endif\n  #import \u003cJPush/JPUSHService.h\u003e\n  #import \u003cJpushWeexPluginModule.h\u003e\n\n  // 2. 应用启动的时候初始化插件，(这个地方很重要)\n  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n  {\n  // your code\n\n      [[[JPushWeexPluginModule alloc] init] setupWithOption:launchOptions\n                                                      appKey:@\"a1703c14b186a68a66ef86c1\"\n                                                     channel:nil\n                                            apsForProduction:nil];\n  }\n\n  // 3. 添加接收事件代码\n  - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken\n  {\n      [JPUSHService registerDeviceToken:deviceToken];\n  }\n\n  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo\n  {\n      [[NSNotificationCenter defaultCenter] postNotificationName:kJPFDidReceiveRemoteNotification object:userInfo];\n  }\n\n  - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification\n  {\n      [[NSNotificationCenter defaultCenter] postNotificationName:kJPFDidReceiveRemoteNotification object: notification.userInfo];\n  }\n\n  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)   (UIBackgroundFetchResult))completionHandler\n  {\n      [[NSNotificationCenter defaultCenter] postNotificationName:kJPFDidReceiveRemoteNotification object:userInfo];\n  }\n  ```\n\n### Android\n\n目前支持本地集成，将 android/library 下载到本地,参考下面步骤配置：\n\n- 修改setting.gradle配置：\n\n\u003e your weex project/android/setting.gradle\n\n```java\n  include \":jpush-weex-plugin\"\n  project (':jpush-weex-plugin').projectDir = new File(\"../../android/library\") // 替换成下你载的插件路径\n\n```\n\n- 修改 app 下的 build.gradle 配置：\n\n\u003e your weex project/android/app/build.gradle\n\n```java\nandroid {\n    defaultConfig {\n        applicationId \"yourApplicationId\"\n        ...\n        manifestPlaceholders = [\n                JPUSH_APPKEY: \"yourAppKey\",         //在此替换你的APPKey\n                JPUSH_CHANNEL: \"developer-default\"  //在此替换你的channel\n        ]\n    }\n}\n\n...\ndependencies {\n    implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n    implementation project(':jpush-weex-plugin')  // 添加 jpush weex 插件依赖\n\n}\n```\n\n同时在 AndridManifest.xml 中添加如下代码\n\n```\n      \u003cmeta-data\n          android:name=\"JPUSH_CHANNEL\"\n          android:value=\"${JPUSH_CHANNEL}\" /\u003e\n      \u003cmeta-data\n          android:name=\"JPUSH_APPKEY\"\n          android:value=\"${JPUSH_APPKEY}\" /\u003e\n```\n\n**操作完成后点击 AndroidStudio 的构建**\n\n- 在 Application 中注册 JPush 插件\n\n```\nimport org.weex.plugin.jpushweexplugin.JpushWeexPluginModule;\n...\npublic class WXApplication extends Application {\n\n  @Override\n  public void onCreate() {\n    super.onCreate();\n    ...\n    WXSDKEngine.registerModule(\"jpushWeexPlugin\", JpushWeexPluginModule.class);\n  }\n\n  ...\n}\n\n```\n\n## APIs\n\n参考 [./src/index.js](./src/index.js).\n\n## Usage\n\n导入 [index.js](./src/index.js) 文件。\n\n```javascript\nimport JPush from \"./src/index.js\";\n\nJPush.init();\n```\n\nExamples: [examples](./examples/index.vue)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjpush-weex-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpush%2Fjpush-weex-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpush%2Fjpush-weex-plugin/lists"}