├── package.json
├── README.md
├── index.d.ts
├── index.js.map
├── index.metadata.json
└── index.js
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ionic3-jpush",
3 | "version": "1.2.0",
4 | "description": "Ionic Native - Native plugins for JPush",
5 | "module": "index.js",
6 | "typings": "index.d.ts",
7 | "author": "lh@lihao.work",
8 | "license": "MIT",
9 | "peerDependencies": {
10 | "@ionic-native/core": "^3.1.0",
11 | "@angular/core": "*",
12 | "rxjs": "^5.0.1"
13 | },
14 | "repository": {
15 | "type": "git",
16 | "url": "https://github.com/lh4111/ionic-jpush"
17 | }
18 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## ionic3-jpush
2 |
3 | [](https://www.npmjs.com/package/ionic3-jpush)
4 |
5 | 基于ionic3 和 ionic-native3 的极光推送封装
6 |
7 | ### 更新说明
8 |
9 | 官方phonegap插件jpush-phonegap-plugin更新了Api。
10 | ionic3-jpush 1.2.0 需要jpush-phonegap-plugin >= 3.2.4。
11 |
12 | >若你的项目适用jpush-phonegap-plugin < 3.24 请使用 ionic3-jpush 1.1.0 `npm i ionic3-jpush@1.1 --save`
13 |
14 | #### 以下Api参数发生变化
15 | Alias API
16 | - setAlias
17 | - deleteAlias
18 | - getAlias
19 |
20 | Tag API
21 | - setTags
22 | - addTags
23 | - deleteTags
24 | - cleanTags
25 | - getAllTags
26 | - checkTagBindState
27 |
28 | ### 如何使用
29 | 1. 安装官方Cordova插件
30 | ```
31 | ionic plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey
32 | ```
33 |
34 | 2. 安装模块`ionic3-jpush`
35 | ```
36 | npm i ionic3-jpush -S
37 | ```
38 |
39 | 3. 在`app.module.ts`中引入,并加入到`@NgModule`的 `providers` 中
40 |
41 | ```
42 | import { JPush } from 'ionic3-jpush';
43 |
44 | @NgModule({
45 | ...
46 | providers: [ JPush ],
47 | })
48 | export class AppModule { }
49 |
50 | ```
51 |
52 | 4. 在Component中调用方法
53 |
54 | ```
55 | //...
56 | import { JPush } from 'ionic3-jpush';
57 |
58 | @Component({
59 | template: `
60 | `
61 | })
62 | export class MyApp {
63 |
64 | constructor (public jPush: JPush){
65 |
66 | this.jPush.getRegistrationID().then(regid => {
67 | console.log(regid)
68 | })
69 |
70 | }
71 | }
72 |
73 | ```
74 |
75 | ### Api说明
76 | - [通用 API 说明(同时适用于 Android 和 iOS 系统)](https://github.com/jpush/jpush-phonegap-plugin/blob/master/doc/Common_detail_api.md)
77 | - [iOS API](https://github.com/jpush/jpush-phonegap-plugin/blob/master/doc/iOS_API.md)
78 | - [Android API ](https://github.com/jpush/jpush-phonegap-plugin/blob/master/doc/Android_detail_api.md)
79 |
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | import { Observable } from 'rxjs/Observable';
2 | /**
3 | * @name JPush
4 | * @description
5 | * This plugin does something
6 | *
7 | * @usage
8 | * ```
9 | * import { JPush } from 'ionic3-jpush';
10 | *
11 | * JPush.functionName('Hello', 123)
12 | * .then((something: any) => doSomething(something))
13 | * .catch((error: any) => console.log(error));
14 | *
15 | * ```
16 | */
17 | export declare class JPush {
18 | /**
19 | * 调用此 API,用来开启 JPush SDK 提供的推送服务。
20 | * 开发者 App 可以通过调用停止推送服务 API 来停止极光推送服务。当又需要使用极光推送服务时,则必须要调用恢复推送服务 API。
21 | * 本功能是一个完全本地的状态操作,也就是说:停止推送服务的状态不会保存到服务器上。
22 | * 如果停止推送服务后,开发者 App 被重新安装,或者被清除数据,JPush SDK 会恢复正常的默认行为(因为保存在本地的状态数据被清除掉了)。
23 | * 本功能其行为类似于网络中断的效果,即:推送服务停止期间推送的消息,恢复推送服务后,如果推送的消息还在保留的时长范围内,则客户端是会收到离线消息。
24 | *
25 | * @returns {Promise}
26 | * @memberof JPush
27 | */
28 | init(): Promise;
29 | /**
30 | * Android:
31 |
32 | * 开发者 App 可以通过调用停止推送服务 API 来停止极光推送服务,当又需要使用极光推送服务时,则必须要调用恢复推送服务 API。
33 | * 调用了本 API 后,JPush 推送服务完全被停止,具体表现为:
34 | * JPush Service 不在后台运行。
35 | * 收不到推送消息。
36 | * 不能通过 init 方法恢复,而需要调用 resumePush 恢复。
37 | * 极光推送其他所有的 API 调用都无效。
38 | * iOS:
39 | *
40 | * 不推荐调用,因为这个 API 只是让你的 DeviceToken 失效,在 设置-通知 中您的应用程序没有任何变化。建议设置一个 UI 界面, 提醒用户在 设置-通知 中关闭推送服务。
41 | *
42 | * @returns {Promise}
43 | * @memberof JPush
44 | */
45 | stopPush(): Promise;
46 | /**
47 | * 恢复推送服务。调用了此 API 后:
48 | * Android 平台:
49 | * 极光推送完全恢复正常工作。
50 | * iOS 平台:
51 | * 重新去 APNS 注册。
52 | *
53 | * @returns {Promise}
54 | * @memberof JPush
55 | */
56 | resumePush(): Promise;
57 | /**
58 | * Android 平台: 用来检查 Push Service 是否已经被停止。
59 | * iOS 平台: 平台检查推送服务是否注册。
60 | *
61 | * @returns {Promise}
62 | * @memberof JPush
63 | */
64 | isPushStopped(): Promise;
65 | /**
66 | * 集成了 JPush SDK 的应用程序在第一次成功注册到 JPush 服务器时,JPush 服务器会给客户端返回一个唯一的该设备的标识 - RegistrationID。 JPush SDK 会以广播的形式发送 RegistrationID 到应用程序。
67 | * 应用程序可以把此 RegistrationID 保存以自己的应用服务器上,然后就可以根据 RegistrationID 来向设备推送消息或者通知。
68 | *
69 | * @returns {Promise}
70 | * @memberof JPush
71 | */
72 | getRegistrationID(): Promise;
73 | /**
74 | * 设置标签。注意这个接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
75 | *
76 | * @param {{ sequence: number, tags?: string[] }} params tags: Array,标签数组
77 | * @returns {Promise}
78 | * @memberof JPush
79 | */
80 | setTags(params: {
81 | sequence: number;
82 | tags?: string[];
83 | }): Promise;
84 | /**
85 | * 新增标签。
86 | *
87 | * @param {{ sequence: number, tags?: string[] }} params tags: Array,标签数组。
88 | * @returns {Promise}
89 | * @memberof JPush
90 | */
91 | addTags(params: {
92 | sequence: number;
93 | tags?: string[];
94 | }): Promise;
95 | /**
96 | * 删除标签
97 | *
98 | * @param {{ sequence: number }} params
99 | * @returns {Promise}
100 | * @memberof JPush
101 | */
102 | deleteTags(params: {
103 | sequence: number;
104 | }): Promise;
105 | /**
106 | * 清除所有标签。
107 | *
108 | * @param {{ sequence: number }} params
109 | * @returns {Promise}
110 | * @memberof JPush
111 | */
112 | cleanTags(params: {
113 | sequence: number;
114 | }): Promise;
115 | /**
116 | * 获取当前绑定的所有标签。
117 | *
118 | * @param {{ sequence: number }} params
119 | * @returns {Promise}
120 | * @memberof JPush
121 | */
122 | getAllTags(params: {
123 | sequence: number;
124 | }): Promise;
125 | /**
126 | * 查询指定tag与当前用户绑定的状态。
127 | *
128 | * @param {{ sequence: number, tag: string }} params tag: string,待查询的 tag。
129 | * @returns {Promise}
130 | * @memberof JPush
131 | */
132 | checkTagBindState(params: {
133 | sequence: number;
134 | tag: string;
135 | }): Promise;
136 | /**
137 | * 设置别名。注意这个接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
138 | *
139 | * @param {{ sequence: number, alias?: string }} params
140 | * sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。
141 | * alias: string。 每次调用设置有效的别名将覆盖之前的设置。 有效的别名组成:字母(区分大小写)、数字、下划线、汉字、特殊字符@!#$&*+=.|。 限制:alias 命名长度限制为 40 字节(判断长度需采用 UTF-8 编码)。
142 | * @returns {Promise}
143 | * @memberof JPush
144 | */
145 | setAlias(params: {
146 | sequence: number;
147 | alias?: string[];
148 | }): Promise;
149 | deleteAlias(params: {
150 | sequence: number;
151 | }): Promise;
152 | getAlias(params: {
153 | sequence: number;
154 | }): Promise;
155 | setBadge(badgeNum?: number): Promise;
156 | setApplicationIconBadgeNumber(badgeNum?: number): Promise;
157 | getApplicationIconBadgeNumber(): Promise;
158 | getUserNotificationSettings(): Promise;
159 | addLocalNotificationForIOS(option: LocalNotificationOption): Promise;
160 | deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: String): Promise;
161 | clearAllLocalNotifications(): Promise;
162 | setLocation(latitude: String | Number, longitude: String | Number): Promise;
163 | isPlatformIOS(): Promise;
164 | addDismissActions(actions: any, categoryId: String): Promise;
165 | addNotificationActions(actions: any, categoryId: String): Promise;
166 | openNotification(): Observable;
167 | receiveNotification(): Observable;
168 | receiveMessage(): Observable;
169 | }
170 | export interface LocalNotificationOption {
171 | delayTime: String | Number;
172 | content: String;
173 | badge: String | Number;
174 | notificationID: String;
175 | extras: Object;
176 | }
177 | export interface DismissActions {
178 | title: String;
179 | identifier: String;
180 | option: String;
181 | type?: String;
182 | textInputButtonTitle?: String;
183 | textInputPlaceholder?: String;
184 | }
185 |
--------------------------------------------------------------------------------
/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/@ionic-native/plugins/j-push/index.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * This is a template for new plugin wrappers\n *\n * TODO:\n * - Add/Change information below\n * - Document usage (importing, executing main functionality)\n * - Remove any imports that you are not using\n * - Add this file to /src/index.ts (follow style of other plugins)\n * - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs.\n * - Remove this note\n *\n */\nimport { Plugin, Cordova } from '@ionic-native/core';\nimport { Observable } from 'rxjs/Observable';\n\n/**\n * @name JPush\n * @description\n * This plugin does something\n *\n * @usage\n * ```\n * import { JPush } from 'ionic3-jpush';\n *\n * JPush.functionName('Hello', 123)\n * .then((something: any) => doSomething(something))\n * .catch((error: any) => console.log(error));\n *\n * ```\n */\n@Plugin({\n pluginName: 'JPush',\n plugin: 'jpush-phonegap-plugin', // npm package name, example: cordova-plugin-camera\n pluginRef: 'plugins.jPushPlugin', // the variable reference to call the plugin, example: navigator.geolocation\n repo: 'https://github.com/jpush/jpush-phonegap-plugin', // the github repository URL for the plugin\n platforms: ['Android', 'iOS']\n // install: '' // OPTIONAL install command, in case the plugin requires variables\n})\nexport class JPush {\n\n /**\n * 调用此 API,用来开启 JPush SDK 提供的推送服务。\n * 开发者 App 可以通过调用停止推送服务 API 来停止极光推送服务。当又需要使用极光推送服务时,则必须要调用恢复推送服务 API。\n * 本功能是一个完全本地的状态操作,也就是说:停止推送服务的状态不会保存到服务器上。\n * 如果停止推送服务后,开发者 App 被重新安装,或者被清除数据,JPush SDK 会恢复正常的默认行为(因为保存在本地的状态数据被清除掉了)。\n * 本功能其行为类似于网络中断的效果,即:推送服务停止期间推送的消息,恢复推送服务后,如果推送的消息还在保留的时长范围内,则客户端是会收到离线消息。\n *\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n init(): Promise {\n return; // We add return; here to avoid any IDE / Compiler errors\n }\n\n /**\n * Android:\n\n * 开发者 App 可以通过调用停止推送服务 API 来停止极光推送服务,当又需要使用极光推送服务时,则必须要调用恢复推送服务 API。\n * 调用了本 API 后,JPush 推送服务完全被停止,具体表现为:\n * JPush Service 不在后台运行。\n * 收不到推送消息。\n * 不能通过 init 方法恢复,而需要调用 resumePush 恢复。\n * 极光推送其他所有的 API 调用都无效。\n * iOS:\n *\n * 不推荐调用,因为这个 API 只是让你的 DeviceToken 失效,在 设置-通知 中您的应用程序没有任何变化。建议设置一个 UI 界面, 提醒用户在 设置-通知 中关闭推送服务。\n *\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n stopPush(): Promise {\n return;\n };\n\n /**\n * 恢复推送服务。调用了此 API 后:\n * Android 平台:\n * 极光推送完全恢复正常工作。\n * iOS 平台:\n * 重新去 APNS 注册。\n *\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n resumePush(): Promise {\n return;\n };\n\n /**\n * Android 平台: 用来检查 Push Service 是否已经被停止。\n * iOS 平台: 平台检查推送服务是否注册。\n *\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n isPushStopped(): Promise {\n return;\n };\n\n /**\n * 集成了 JPush SDK 的应用程序在第一次成功注册到 JPush 服务器时,JPush 服务器会给客户端返回一个唯一的该设备的标识 - RegistrationID。 JPush SDK 会以广播的形式发送 RegistrationID 到应用程序。\n * 应用程序可以把此 RegistrationID 保存以自己的应用服务器上,然后就可以根据 RegistrationID 来向设备推送消息或者通知。\n *\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n getRegistrationID(): Promise {\n return;\n };\n\n /**\n * 设置标签。注意这个接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。\n *\n * @param {{ sequence: number, tags?: string[] }} params tags: Array,标签数组\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n setTags(params: { sequence: number, tags?: string[] }): Promise {\n return;\n };\n\n /**\n * 新增标签。\n *\n * @param {{ sequence: number, tags?: string[] }} params tags: Array,标签数组。\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n addTags(params: { sequence: number, tags?: string[] }): Promise {\n return;\n };\n\n /**\n * 删除标签\n *\n * @param {{ sequence: number }} params\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n deleteTags(params: { sequence: number }): Promise {\n return;\n };\n\n /**\n * 清除所有标签。\n *\n * @param {{ sequence: number }} params\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n cleanTags(params: { sequence: number }): Promise {\n return;\n };\n\n /**\n * 获取当前绑定的所有标签。\n *\n * @param {{ sequence: number }} params\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n getAllTags(params: { sequence: number }): Promise {\n return;\n };\n\n /**\n * 查询指定tag与当前用户绑定的状态。\n *\n * @param {{ sequence: number, tag: string }} params tag: string,待查询的 tag。\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n checkTagBindState(params: { sequence: number, tag: string }): Promise {\n return;\n };\n\n /**\n * 设置别名。注意这个接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。\n *\n * @param {{ sequence: number, alias?: string }} params\n * sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。\n * alias: string。 每次调用设置有效的别名将覆盖之前的设置。 有效的别名组成:字母(区分大小写)、数字、下划线、汉字、特殊字符@!#$&*+=.|。 限制:alias 命名长度限制为 40 字节(判断长度需采用 UTF-8 编码)。\n * @returns {Promise}\n * @memberof JPush\n */\n @Cordova()\n setAlias(params: { sequence: number, alias?: string[] }): Promise {\n return;\n };\n\n @Cordova()\n deleteAlias(params: { sequence: number }): Promise {\n return;\n };\n\n @Cordova()\n getAlias(params: { sequence: number }): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n setBadge(badgeNum?: number): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n setApplicationIconBadgeNumber(badgeNum?: number): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n getApplicationIconBadgeNumber(): Promise {\n return;\n };\n\n @Cordova()\n getUserNotificationSettings(): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n addLocalNotificationForIOS(option: LocalNotificationOption): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: String): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n clearAllLocalNotifications(): Promise {\n return;\n };\n\n @Cordova()\n setLocation(latitude: String | Number, longitude: String | Number): Promise {\n return;\n };\n\n @Cordova()\n isPlatformIOS(): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n addDismissActions(actions, categoryId: String): Promise {\n return;\n };\n\n @Cordova({\n platforms: ['iOS']\n })\n addNotificationActions(actions, categoryId: String): Promise {\n return;\n };\n\n @Cordova({\n eventObservable: true,\n event: 'jpush.openNotification',\n element: document\n })\n openNotification(): Observable {\n return;\n };\n\n @Cordova({\n eventObservable: true,\n event: 'jpush.receiveNotification',\n element: document\n })\n receiveNotification(): Observable {\n return;\n };\n\n @Cordova({\n eventObservable: true,\n event: 'jpush.receiveMessage',\n element: document\n })\n receiveMessage(): Observable {\n return;\n };\n}\n\nexport interface LocalNotificationOption {\n delayTime: String | Number;\n content: String;\n badge: String | Number;\n notificationID: String;\n extras: Object;\n}\n\nexport interface DismissActions {\n title: String;\n identifier: String;\n option: String;\n type?: String;\n textInputButtonTitle?: String;\n textInputPlaceholder?: String;\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
--------------------------------------------------------------------------------
/index.metadata.json:
--------------------------------------------------------------------------------
1 | [{"__symbolic":"module","version":3,"metadata":{"JPush":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Plugin"},"arguments":[{"pluginName":"JPush","plugin":"jpush-phonegap-plugin","pluginRef":"plugins.jPushPlugin","repo":"https://github.com/jpush/jpush-phonegap-plugin","platforms":["Android","iOS"]}]}],"members":{"init":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"stopPush":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"resumePush":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"isPushStopped":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getRegistrationID":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"deleteTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"cleanTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getAllTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"checkTagBindState":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"deleteAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setBadge":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"setApplicationIconBadgeNumber":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"getApplicationIconBadgeNumber":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"getUserNotificationSettings":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addLocalNotificationForIOS":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"deleteLocalNotificationWithIdentifierKeyInIOS":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"clearAllLocalNotifications":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"setLocation":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"isPlatformIOS":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addDismissActions":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"addNotificationActions":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"openNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"eventObservable":true,"event":"jpush.openNotification","element":{"__symbolic":"reference","name":"document"}}]}]}],"receiveNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"eventObservable":true,"event":"jpush.receiveNotification","element":{"__symbolic":"reference","name":"document"}}]}]}],"receiveMessage":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"eventObservable":true,"event":"jpush.receiveMessage","element":{"__symbolic":"reference","name":"document"}}]}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"JPush":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Plugin"},"arguments":[{"pluginName":"JPush","plugin":"jpush-phonegap-plugin","pluginRef":"plugins.jPushPlugin","repo":"https://github.com/jpush/jpush-phonegap-plugin","platforms":["Android","iOS"]}]}],"members":{"init":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"stopPush":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"resumePush":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"isPushStopped":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getRegistrationID":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"deleteTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"cleanTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getAllTags":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"checkTagBindState":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"deleteAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getAlias":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setBadge":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"setApplicationIconBadgeNumber":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"getApplicationIconBadgeNumber":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"getUserNotificationSettings":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addLocalNotificationForIOS":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"deleteLocalNotificationWithIdentifierKeyInIOS":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"clearAllLocalNotifications":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"setLocation":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"isPlatformIOS":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addDismissActions":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"addNotificationActions":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"platforms":["iOS"]}]}]}],"openNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"eventObservable":true,"event":"jpush.openNotification","element":{"__symbolic":"reference","name":"document"}}]}]}],"receiveNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"eventObservable":true,"event":"jpush.receiveNotification","element":{"__symbolic":"reference","name":"document"}}]}]}],"receiveMessage":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"},"arguments":[{"eventObservable":true,"event":"jpush.receiveMessage","element":{"__symbolic":"reference","name":"document"}}]}]}]}}}}]
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5 | return c > 3 && r && Object.defineProperty(target, key, r), r;
6 | };
7 | var __metadata = (this && this.__metadata) || function (k, v) {
8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9 | };
10 | import { Plugin, Cordova } from '@ionic-native/core';
11 | import { Observable } from 'rxjs/Observable';
12 | /**
13 | * @name JPush
14 | * @description
15 | * This plugin does something
16 | *
17 | * @usage
18 | * ```
19 | * import { JPush } from 'ionic3-jpush';
20 | *
21 | * JPush.functionName('Hello', 123)
22 | * .then((something: any) => doSomething(something))
23 | * .catch((error: any) => console.log(error));
24 | *
25 | * ```
26 | */
27 | export var JPush = (function () {
28 | function JPush() {
29 | }
30 | /**
31 | * 调用此 API,用来开启 JPush SDK 提供的推送服务。
32 | * 开发者 App 可以通过调用停止推送服务 API 来停止极光推送服务。当又需要使用极光推送服务时,则必须要调用恢复推送服务 API。
33 | * 本功能是一个完全本地的状态操作,也就是说:停止推送服务的状态不会保存到服务器上。
34 | * 如果停止推送服务后,开发者 App 被重新安装,或者被清除数据,JPush SDK 会恢复正常的默认行为(因为保存在本地的状态数据被清除掉了)。
35 | * 本功能其行为类似于网络中断的效果,即:推送服务停止期间推送的消息,恢复推送服务后,如果推送的消息还在保留的时长范围内,则客户端是会收到离线消息。
36 | *
37 | * @returns {Promise}
38 | * @memberof JPush
39 | */
40 | JPush.prototype.init = function () {
41 | return; // We add return; here to avoid any IDE / Compiler errors
42 | };
43 | /**
44 | * Android:
45 |
46 | * 开发者 App 可以通过调用停止推送服务 API 来停止极光推送服务,当又需要使用极光推送服务时,则必须要调用恢复推送服务 API。
47 | * 调用了本 API 后,JPush 推送服务完全被停止,具体表现为:
48 | * JPush Service 不在后台运行。
49 | * 收不到推送消息。
50 | * 不能通过 init 方法恢复,而需要调用 resumePush 恢复。
51 | * 极光推送其他所有的 API 调用都无效。
52 | * iOS:
53 | *
54 | * 不推荐调用,因为这个 API 只是让你的 DeviceToken 失效,在 设置-通知 中您的应用程序没有任何变化。建议设置一个 UI 界面, 提醒用户在 设置-通知 中关闭推送服务。
55 | *
56 | * @returns {Promise}
57 | * @memberof JPush
58 | */
59 | JPush.prototype.stopPush = function () {
60 | return;
61 | };
62 | ;
63 | /**
64 | * 恢复推送服务。调用了此 API 后:
65 | * Android 平台:
66 | * 极光推送完全恢复正常工作。
67 | * iOS 平台:
68 | * 重新去 APNS 注册。
69 | *
70 | * @returns {Promise}
71 | * @memberof JPush
72 | */
73 | JPush.prototype.resumePush = function () {
74 | return;
75 | };
76 | ;
77 | /**
78 | * Android 平台: 用来检查 Push Service 是否已经被停止。
79 | * iOS 平台: 平台检查推送服务是否注册。
80 | *
81 | * @returns {Promise}
82 | * @memberof JPush
83 | */
84 | JPush.prototype.isPushStopped = function () {
85 | return;
86 | };
87 | ;
88 | /**
89 | * 集成了 JPush SDK 的应用程序在第一次成功注册到 JPush 服务器时,JPush 服务器会给客户端返回一个唯一的该设备的标识 - RegistrationID。 JPush SDK 会以广播的形式发送 RegistrationID 到应用程序。
90 | * 应用程序可以把此 RegistrationID 保存以自己的应用服务器上,然后就可以根据 RegistrationID 来向设备推送消息或者通知。
91 | *
92 | * @returns {Promise}
93 | * @memberof JPush
94 | */
95 | JPush.prototype.getRegistrationID = function () {
96 | return;
97 | };
98 | ;
99 | /**
100 | * 设置标签。注意这个接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
101 | *
102 | * @param {{ sequence: number, tags?: string[] }} params tags: Array,标签数组
103 | * @returns {Promise}
104 | * @memberof JPush
105 | */
106 | JPush.prototype.setTags = function (params) {
107 | return;
108 | };
109 | ;
110 | /**
111 | * 新增标签。
112 | *
113 | * @param {{ sequence: number, tags?: string[] }} params tags: Array,标签数组。
114 | * @returns {Promise}
115 | * @memberof JPush
116 | */
117 | JPush.prototype.addTags = function (params) {
118 | return;
119 | };
120 | ;
121 | /**
122 | * 删除标签
123 | *
124 | * @param {{ sequence: number }} params
125 | * @returns {Promise}
126 | * @memberof JPush
127 | */
128 | JPush.prototype.deleteTags = function (params) {
129 | return;
130 | };
131 | ;
132 | /**
133 | * 清除所有标签。
134 | *
135 | * @param {{ sequence: number }} params
136 | * @returns {Promise}
137 | * @memberof JPush
138 | */
139 | JPush.prototype.cleanTags = function (params) {
140 | return;
141 | };
142 | ;
143 | /**
144 | * 获取当前绑定的所有标签。
145 | *
146 | * @param {{ sequence: number }} params
147 | * @returns {Promise}
148 | * @memberof JPush
149 | */
150 | JPush.prototype.getAllTags = function (params) {
151 | return;
152 | };
153 | ;
154 | /**
155 | * 查询指定tag与当前用户绑定的状态。
156 | *
157 | * @param {{ sequence: number, tag: string }} params tag: string,待查询的 tag。
158 | * @returns {Promise}
159 | * @memberof JPush
160 | */
161 | JPush.prototype.checkTagBindState = function (params) {
162 | return;
163 | };
164 | ;
165 | /**
166 | * 设置别名。注意这个接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
167 | *
168 | * @param {{ sequence: number, alias?: string }} params
169 | * sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。
170 | * alias: string。 每次调用设置有效的别名将覆盖之前的设置。 有效的别名组成:字母(区分大小写)、数字、下划线、汉字、特殊字符@!#$&*+=.|。 限制:alias 命名长度限制为 40 字节(判断长度需采用 UTF-8 编码)。
171 | * @returns {Promise}
172 | * @memberof JPush
173 | */
174 | JPush.prototype.setAlias = function (params) {
175 | return;
176 | };
177 | ;
178 | JPush.prototype.deleteAlias = function (params) {
179 | return;
180 | };
181 | ;
182 | JPush.prototype.getAlias = function (params) {
183 | return;
184 | };
185 | ;
186 | JPush.prototype.setBadge = function (badgeNum) {
187 | return;
188 | };
189 | ;
190 | JPush.prototype.setApplicationIconBadgeNumber = function (badgeNum) {
191 | return;
192 | };
193 | ;
194 | JPush.prototype.getApplicationIconBadgeNumber = function () {
195 | return;
196 | };
197 | ;
198 | JPush.prototype.getUserNotificationSettings = function () {
199 | return;
200 | };
201 | ;
202 | JPush.prototype.addLocalNotificationForIOS = function (option) {
203 | return;
204 | };
205 | ;
206 | JPush.prototype.deleteLocalNotificationWithIdentifierKeyInIOS = function (identifierKey) {
207 | return;
208 | };
209 | ;
210 | JPush.prototype.clearAllLocalNotifications = function () {
211 | return;
212 | };
213 | ;
214 | JPush.prototype.setLocation = function (latitude, longitude) {
215 | return;
216 | };
217 | ;
218 | JPush.prototype.isPlatformIOS = function () {
219 | return;
220 | };
221 | ;
222 | JPush.prototype.addDismissActions = function (actions, categoryId) {
223 | return;
224 | };
225 | ;
226 | JPush.prototype.addNotificationActions = function (actions, categoryId) {
227 | return;
228 | };
229 | ;
230 | JPush.prototype.openNotification = function () {
231 | return;
232 | };
233 | ;
234 | JPush.prototype.receiveNotification = function () {
235 | return;
236 | };
237 | ;
238 | JPush.prototype.receiveMessage = function () {
239 | return;
240 | };
241 | ;
242 | __decorate([
243 | Cordova(),
244 | __metadata('design:type', Function),
245 | __metadata('design:paramtypes', []),
246 | __metadata('design:returntype', Promise)
247 | ], JPush.prototype, "init", null);
248 | __decorate([
249 | Cordova(),
250 | __metadata('design:type', Function),
251 | __metadata('design:paramtypes', []),
252 | __metadata('design:returntype', Promise)
253 | ], JPush.prototype, "stopPush", null);
254 | __decorate([
255 | Cordova(),
256 | __metadata('design:type', Function),
257 | __metadata('design:paramtypes', []),
258 | __metadata('design:returntype', Promise)
259 | ], JPush.prototype, "resumePush", null);
260 | __decorate([
261 | Cordova(),
262 | __metadata('design:type', Function),
263 | __metadata('design:paramtypes', []),
264 | __metadata('design:returntype', Promise)
265 | ], JPush.prototype, "isPushStopped", null);
266 | __decorate([
267 | Cordova(),
268 | __metadata('design:type', Function),
269 | __metadata('design:paramtypes', []),
270 | __metadata('design:returntype', Promise)
271 | ], JPush.prototype, "getRegistrationID", null);
272 | __decorate([
273 | Cordova(),
274 | __metadata('design:type', Function),
275 | __metadata('design:paramtypes', [Object]),
276 | __metadata('design:returntype', Promise)
277 | ], JPush.prototype, "setTags", null);
278 | __decorate([
279 | Cordova(),
280 | __metadata('design:type', Function),
281 | __metadata('design:paramtypes', [Object]),
282 | __metadata('design:returntype', Promise)
283 | ], JPush.prototype, "addTags", null);
284 | __decorate([
285 | Cordova(),
286 | __metadata('design:type', Function),
287 | __metadata('design:paramtypes', [Object]),
288 | __metadata('design:returntype', Promise)
289 | ], JPush.prototype, "deleteTags", null);
290 | __decorate([
291 | Cordova(),
292 | __metadata('design:type', Function),
293 | __metadata('design:paramtypes', [Object]),
294 | __metadata('design:returntype', Promise)
295 | ], JPush.prototype, "cleanTags", null);
296 | __decorate([
297 | Cordova(),
298 | __metadata('design:type', Function),
299 | __metadata('design:paramtypes', [Object]),
300 | __metadata('design:returntype', Promise)
301 | ], JPush.prototype, "getAllTags", null);
302 | __decorate([
303 | Cordova(),
304 | __metadata('design:type', Function),
305 | __metadata('design:paramtypes', [Object]),
306 | __metadata('design:returntype', Promise)
307 | ], JPush.prototype, "checkTagBindState", null);
308 | __decorate([
309 | Cordova(),
310 | __metadata('design:type', Function),
311 | __metadata('design:paramtypes', [Object]),
312 | __metadata('design:returntype', Promise)
313 | ], JPush.prototype, "setAlias", null);
314 | __decorate([
315 | Cordova(),
316 | __metadata('design:type', Function),
317 | __metadata('design:paramtypes', [Object]),
318 | __metadata('design:returntype', Promise)
319 | ], JPush.prototype, "deleteAlias", null);
320 | __decorate([
321 | Cordova(),
322 | __metadata('design:type', Function),
323 | __metadata('design:paramtypes', [Object]),
324 | __metadata('design:returntype', Promise)
325 | ], JPush.prototype, "getAlias", null);
326 | __decorate([
327 | Cordova({
328 | platforms: ['iOS']
329 | }),
330 | __metadata('design:type', Function),
331 | __metadata('design:paramtypes', [Number]),
332 | __metadata('design:returntype', Promise)
333 | ], JPush.prototype, "setBadge", null);
334 | __decorate([
335 | Cordova({
336 | platforms: ['iOS']
337 | }),
338 | __metadata('design:type', Function),
339 | __metadata('design:paramtypes', [Number]),
340 | __metadata('design:returntype', Promise)
341 | ], JPush.prototype, "setApplicationIconBadgeNumber", null);
342 | __decorate([
343 | Cordova({
344 | platforms: ['iOS']
345 | }),
346 | __metadata('design:type', Function),
347 | __metadata('design:paramtypes', []),
348 | __metadata('design:returntype', Promise)
349 | ], JPush.prototype, "getApplicationIconBadgeNumber", null);
350 | __decorate([
351 | Cordova(),
352 | __metadata('design:type', Function),
353 | __metadata('design:paramtypes', []),
354 | __metadata('design:returntype', Promise)
355 | ], JPush.prototype, "getUserNotificationSettings", null);
356 | __decorate([
357 | Cordova({
358 | platforms: ['iOS']
359 | }),
360 | __metadata('design:type', Function),
361 | __metadata('design:paramtypes', [Object]),
362 | __metadata('design:returntype', Promise)
363 | ], JPush.prototype, "addLocalNotificationForIOS", null);
364 | __decorate([
365 | Cordova({
366 | platforms: ['iOS']
367 | }),
368 | __metadata('design:type', Function),
369 | __metadata('design:paramtypes', [String]),
370 | __metadata('design:returntype', Promise)
371 | ], JPush.prototype, "deleteLocalNotificationWithIdentifierKeyInIOS", null);
372 | __decorate([
373 | Cordova({
374 | platforms: ['iOS']
375 | }),
376 | __metadata('design:type', Function),
377 | __metadata('design:paramtypes', []),
378 | __metadata('design:returntype', Promise)
379 | ], JPush.prototype, "clearAllLocalNotifications", null);
380 | __decorate([
381 | Cordova(),
382 | __metadata('design:type', Function),
383 | __metadata('design:paramtypes', [Object, Object]),
384 | __metadata('design:returntype', Promise)
385 | ], JPush.prototype, "setLocation", null);
386 | __decorate([
387 | Cordova(),
388 | __metadata('design:type', Function),
389 | __metadata('design:paramtypes', []),
390 | __metadata('design:returntype', Promise)
391 | ], JPush.prototype, "isPlatformIOS", null);
392 | __decorate([
393 | Cordova({
394 | platforms: ['iOS']
395 | }),
396 | __metadata('design:type', Function),
397 | __metadata('design:paramtypes', [Object, String]),
398 | __metadata('design:returntype', Promise)
399 | ], JPush.prototype, "addDismissActions", null);
400 | __decorate([
401 | Cordova({
402 | platforms: ['iOS']
403 | }),
404 | __metadata('design:type', Function),
405 | __metadata('design:paramtypes', [Object, String]),
406 | __metadata('design:returntype', Promise)
407 | ], JPush.prototype, "addNotificationActions", null);
408 | __decorate([
409 | Cordova({
410 | eventObservable: true,
411 | event: 'jpush.openNotification',
412 | element: document
413 | }),
414 | __metadata('design:type', Function),
415 | __metadata('design:paramtypes', []),
416 | __metadata('design:returntype', Observable)
417 | ], JPush.prototype, "openNotification", null);
418 | __decorate([
419 | Cordova({
420 | eventObservable: true,
421 | event: 'jpush.receiveNotification',
422 | element: document
423 | }),
424 | __metadata('design:type', Function),
425 | __metadata('design:paramtypes', []),
426 | __metadata('design:returntype', Observable)
427 | ], JPush.prototype, "receiveNotification", null);
428 | __decorate([
429 | Cordova({
430 | eventObservable: true,
431 | event: 'jpush.receiveMessage',
432 | element: document
433 | }),
434 | __metadata('design:type', Function),
435 | __metadata('design:paramtypes', []),
436 | __metadata('design:returntype', Observable)
437 | ], JPush.prototype, "receiveMessage", null);
438 | JPush = __decorate([
439 | Plugin({
440 | pluginName: 'JPush',
441 | plugin: 'jpush-phonegap-plugin',
442 | pluginRef: 'plugins.jPushPlugin',
443 | repo: 'https://github.com/jpush/jpush-phonegap-plugin',
444 | platforms: ['Android', 'iOS']
445 | }),
446 | __metadata('design:paramtypes', [])
447 | ], JPush);
448 | return JPush;
449 | }());
450 | //# sourceMappingURL=index.js.map
--------------------------------------------------------------------------------