diff --git a/doc/iOS_API.md b/doc/iOS_API.md index 8c79704..c1b5ee9 100644 --- a/doc/iOS_API.md +++ b/doc/iOS_API.md @@ -379,7 +379,7 @@ window.JPush.addLocalNotificationForIOS(delayTime, content, badge, notificationI #### 参数说明 -- delayTime: 本地推送延迟多长时间后显示,数值类型或纯数字的字符型均可。 +- delayTime: 本地推送延迟多长时间后显示,数值类型或纯数字的字符型均可,单位为秒。 - content: 本地推送需要显示的内容。 - badge: 角标的数字。如果不需要改变角标传-1。数值类型或纯数字的字符型均可。 - notificationID: 本地推送标识符,字符串。 diff --git a/example/js/.DS_Store b/example/js/.DS_Store deleted file mode 100644 index 924b172..0000000 Binary files a/example/js/.DS_Store and /dev/null differ diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..5d875c6 --- /dev/null +++ b/index.ts @@ -0,0 +1,171 @@ +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; + +export interface TagOptions { + sequence: number; + tags?: Array; +} + +export interface AliasOptions { + sequence: number; + alias?: string; +} + +@Plugin({ + pluginName: 'JPush', + plugin: 'jpush-phonegap-plugin', + pluginRef: 'plugins.jPushPlugin', + repo: 'https://github.com/jpush/jpush-phonegap-plugin', + install: 'ionic cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_app_key', + installVariables: ['APP_KEY'], + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class JPush extends IonicNativePlugin { + + @Cordova() + init(): Promise { return; } + + @Cordova() + setDebugMode(enable: boolean): Promise { return; } + + @Cordova() + getRegistrationID(): Promise { return; } + + @Cordova() + stopPush(): Promise { return; } + + @Cordova() + resumePush(): Promise { return; } + + @Cordova() + isPushStopped(): Promise { return; } + + @Cordova() + setTags(params: TagOptions): Promise { return; } + + @Cordova() + addTags(params: TagOptions): Promise { return; } + + @Cordova() + deleteTags(params: TagOptions): Promise { return; } + + @Cordova() + cleanTags(params: TagOptions): Promise { return; } + + @Cordova() + getAllTags(params: TagOptions): Promise { return; } + + /** + * @param params { sequence: number, tag: string } + */ + @Cordova() + checkTagBindState(params: object): Promise { return; } + + @Cordova() + setAlias(params: AliasOptions): Promise { return; } + + @Cordova() + deleteAlias(params: AliasOptions): Promise { return; } + + @Cordova() + getAlias(params: AliasOptions): Promise { return; } + + /** + * Determinate whether the application notification has been opened. + * + * iOS: 0: closed; >1: opened. + * UIRemoteNotificationTypeNone = 0, + * UIRemoteNotificationTypeBadge = 1 << 0, + * UIRemoteNotificationTypeSound = 1 << 1, + * UIRemoteNotificationTypeAlert = 1 << 2, + * UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3 + * + * Android: 0: closed; 1: opened. + */ + @Cordova() + getUserNotificationSettings(): Promise { return; } + + @Cordova() + clearLocalNotifications(): Promise { return; } + + // iOS API - start + + @Cordova() + setBadge(badge: number): Promise { return; } + + @Cordova() + resetBadge(): Promise { return; } + + @Cordova() + setApplicationIconBadgeNumber(badge: number): Promise { return; } + + @Cordova() + getApplicationIconBadgeNumber(): Promise { return; } + + @Cordova() + addLocalNotificationForIOS(delayTime: number, content: string, badge: number, identifierKey: string, extras?: string): Promise { return; } + + @Cordova() + deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: string): Promise { return; } + + @Cordova() + addDismissActions(actions: Array, categoryId: string): Promise { return; } + + @Cordova() + addNotificationActions(actions: Array, categoryId: string): Promise { return; } + + @Cordova() + setLocation(latitude: number, longitude: number): Promise { return; } + + @Cordova() + startLogPageView(pageName: string): Promise { return; } + + @Cordova() + stopLogPageView(pageName: string): Promise { return; } + + @Cordova() + beginLogPageView(pageName: string, duration: number): Promise { return; } + + // iOS API - end + + // Android API - start + + @Cordova() + getConnectionState(): Promise { return; } + + @Cordova() + setBasicPushNotificationBuilder(): Promise { return; } + + @Cordova() + setCustomPushNotificationBuilder(): Promise { return; } + + @Cordova() + clearAllNotification(): Promise { return; } + + @Cordova() + clearNotificationById(id: number): Promise { return; } + + @Cordova() + setLatestNotificationNum(num: number): Promise { return; } + + @Cordova() + addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise { return; } + + @Cordova() + removeLocalNotification(notificationId: number): Promise { return; } + + @Cordova() + reportNotificationOpened(msgId: number): Promise { return; } + + @Cordova() + requestPermission(): Promise { return; } + + @Cordova() + setSilenceTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise { return; } + + @Cordova() + setPushTime(weekdays: Array, startHour: number, endHour: number): Promise { return; } + + // Android API - end +} diff --git a/ionic/example b/ionic/example new file mode 160000 index 0000000..148e087 --- /dev/null +++ b/ionic/example @@ -0,0 +1 @@ +Subproject commit 148e087db2e678772a09fa83d3cff17c496acbb6 diff --git a/ionic/jpush/index.d.ts b/ionic/jpush/index.d.ts new file mode 100644 index 0000000..db7461b --- /dev/null +++ b/ionic/jpush/index.d.ts @@ -0,0 +1,67 @@ +import { IonicNativePlugin } from '@ionic-native/core'; +export interface TagOptions { + sequence: number; + tags?: Array; +} +export interface AliasOptions { + sequence: number; + alias?: string; +} +export declare class JPush extends IonicNativePlugin { + init(): Promise; + setDebugMode(enable: boolean): Promise; + getRegistrationID(): Promise; + stopPush(): Promise; + resumePush(): Promise; + isPushStopped(): Promise; + setTags(params: TagOptions): Promise; + addTags(params: TagOptions): Promise; + deleteTags(params: TagOptions): Promise; + cleanTags(params: TagOptions): Promise; + getAllTags(params: TagOptions): Promise; + /** + * @param params { sequence: number, tag: string } + */ + checkTagBindState(params: object): Promise; + setAlias(params: AliasOptions): Promise; + deleteAlias(params: AliasOptions): Promise; + getAlias(params: AliasOptions): Promise; + /** + * Determinate whether the application notification has been opened. + * + * iOS: 0: closed; >1: opened. + * UIRemoteNotificationTypeNone = 0, + * UIRemoteNotificationTypeBadge = 1 << 0, + * UIRemoteNotificationTypeSound = 1 << 1, + * UIRemoteNotificationTypeAlert = 1 << 2, + * UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3 + * + * Android: 0: closed; 1: opened. + */ + getUserNotificationSettings(): Promise; + clearLocalNotifications(): Promise; + setBadge(badge: number): Promise; + resetBadge(): Promise; + setApplicationIconBadgeNumber(badge: number): Promise; + getApplicationIconBadgeNumber(): Promise; + addLocalNotificationForIOS(delayTime: number, content: string, badge: number, notificationId: number, extras?: string): Promise; + deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: string): Promise; + addDismissActions(actions: Array, categoryId: string): Promise; + addNotificationActions(actions: Array, categoryId: string): Promise; + setLocation(latitude: number, longitude: number): Promise; + startLogPageView(pageName: string): Promise; + stopLogPageView(pageName: string): Promise; + beginLogPageView(pageName: string, duration: number): Promise; + getConnectionState(): Promise; + setBasicPushNotificationBuilder(): Promise; + setCustomPushNotificationBuilder(): Promise; + clearAllNotification(): Promise; + clearNotificationById(id: number): Promise; + setLatestNotificationNum(num: number): Promise; + addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise; + removeLocalNotification(notificationId: number): Promise; + reportNotificationOpened(msgId: number): Promise; + requestPermission(): Promise; + setSilenceTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise; + setPushTime(weekdays: Array, startHour: number, endHour: number): Promise; +} diff --git a/ionic/jpush/index.js b/ionic/jpush/index.js new file mode 100644 index 0000000..f0de886 --- /dev/null +++ b/ionic/jpush/index.js @@ -0,0 +1,352 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + 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; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; +var JPush = (function (_super) { + __extends(JPush, _super); + function JPush() { + return _super !== null && _super.apply(this, arguments) || this; + } + JPush.prototype.init = function () { return; }; + JPush.prototype.setDebugMode = function (enable) { return; }; + JPush.prototype.getRegistrationID = function () { return; }; + JPush.prototype.stopPush = function () { return; }; + JPush.prototype.resumePush = function () { return; }; + JPush.prototype.isPushStopped = function () { return; }; + JPush.prototype.setTags = function (params) { return; }; + JPush.prototype.addTags = function (params) { return; }; + JPush.prototype.deleteTags = function (params) { return; }; + JPush.prototype.cleanTags = function (params) { return; }; + JPush.prototype.getAllTags = function (params) { return; }; + /** + * @param params { sequence: number, tag: string } + */ + JPush.prototype.checkTagBindState = function (params) { return; }; + JPush.prototype.setAlias = function (params) { return; }; + JPush.prototype.deleteAlias = function (params) { return; }; + JPush.prototype.getAlias = function (params) { return; }; + /** + * Determinate whether the application notification has been opened. + * + * iOS: 0: closed; >1: opened. + * UIRemoteNotificationTypeNone = 0, + * UIRemoteNotificationTypeBadge = 1 << 0, + * UIRemoteNotificationTypeSound = 1 << 1, + * UIRemoteNotificationTypeAlert = 1 << 2, + * UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3 + * + * Android: 0: closed; 1: opened. + */ + JPush.prototype.getUserNotificationSettings = function () { return; }; + JPush.prototype.clearLocalNotifications = function () { return; }; + // iOS API - start + JPush.prototype.setBadge = function (badge) { return; }; + JPush.prototype.resetBadge = function () { return; }; + JPush.prototype.setApplicationIconBadgeNumber = function (badge) { return; }; + JPush.prototype.getApplicationIconBadgeNumber = function () { return; }; + JPush.prototype.addLocalNotificationForIOS = function (delayTime, content, badge, notificationId, extras) { return; }; + JPush.prototype.deleteLocalNotificationWithIdentifierKeyInIOS = function (identifierKey) { return; }; + JPush.prototype.addDismissActions = function (actions, categoryId) { return; }; + JPush.prototype.addNotificationActions = function (actions, categoryId) { return; }; + JPush.prototype.setLocation = function (latitude, longitude) { return; }; + JPush.prototype.startLogPageView = function (pageName) { return; }; + JPush.prototype.stopLogPageView = function (pageName) { return; }; + JPush.prototype.beginLogPageView = function (pageName, duration) { return; }; + // iOS API - end + // Android API - start + JPush.prototype.getConnectionState = function () { return; }; + JPush.prototype.setBasicPushNotificationBuilder = function () { return; }; + JPush.prototype.setCustomPushNotificationBuilder = function () { return; }; + JPush.prototype.clearAllNotification = function () { return; }; + JPush.prototype.clearNotificationById = function (id) { return; }; + JPush.prototype.setLatestNotificationNum = function (num) { return; }; + JPush.prototype.addLocalNotification = function (builderId, content, title, notificationId, broadcastTime, extras) { return; }; + JPush.prototype.removeLocalNotification = function (notificationId) { return; }; + JPush.prototype.reportNotificationOpened = function (msgId) { return; }; + JPush.prototype.requestPermission = function () { return; }; + JPush.prototype.setSilenceTime = function (startHour, startMinute, endHour, endMinute) { return; }; + JPush.prototype.setPushTime = function (weekdays, startHour, endHour) { return; }; + // Android API - end + JPush.decorators = [ + { type: Injectable }, + ]; + /** @nocollapse */ + JPush.ctorParameters = function () { return []; }; + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "init", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setDebugMode", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "getRegistrationID", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "stopPush", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "resumePush", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "isPushStopped", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setTags", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "addTags", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "deleteTags", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "cleanTags", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "getAllTags", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "checkTagBindState", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setAlias", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "deleteAlias", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "getAlias", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "getUserNotificationSettings", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "clearLocalNotifications", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setBadge", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "resetBadge", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setApplicationIconBadgeNumber", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "getApplicationIconBadgeNumber", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number, String, Number, Number, String]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "addLocalNotificationForIOS", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "deleteLocalNotificationWithIdentifierKeyInIOS", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Array, String]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "addDismissActions", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Array, String]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "addNotificationActions", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number, Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setLocation", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "startLogPageView", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "stopLogPageView", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String, Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "beginLogPageView", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "getConnectionState", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setBasicPushNotificationBuilder", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setCustomPushNotificationBuilder", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "clearAllNotification", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "clearNotificationById", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setLatestNotificationNum", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number, String, String, Number, Number, String]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "addLocalNotification", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "removeLocalNotification", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "reportNotificationOpened", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) + ], JPush.prototype, "requestPermission", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number, Number, Number, Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setSilenceTime", null); + __decorate([ + Cordova(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Array, Number, Number]), + __metadata("design:returntype", Promise) + ], JPush.prototype, "setPushTime", null); + JPush = __decorate([ + Plugin({ + pluginName: 'JPush', + plugin: 'jpush-phonegap-plugin', + pluginRef: 'plugins.jPushPlugin', + repo: 'https://github.com/jpush/jpush-phonegap-plugin', + install: 'ionic cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_app_key', + installVariables: ['APP_KEY'], + platforms: ['Android', 'iOS'] + }) + ], JPush); + return JPush; +}(IonicNativePlugin)); +export { JPush }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/ionic/jpush/index.js.map b/ionic/jpush/index.js.map new file mode 100644 index 0000000..1c8d866 --- /dev/null +++ b/ionic/jpush/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/@ionic-native/plugins/jpush/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAA,EAAQ,OAAA,EAAS,iBAAA,EAAkB,MAAO,oBAAA,CAAqB;AACxE,OAAO,EAAE,UAAA,EAAW,MAAO,eAAA,CAAgB;AAsB3C;IAA2B,yBAAiB;IAA5C;;IAyJA,CAAC;IAtJC,oBAAI,GAAJ,cAAuB,MAAM,CAAC,CAAC,CAAC;IAGhC,4BAAY,GAAZ,UAAa,MAAe,IAAkB,MAAM,CAAC,CAAC,CAAC;IAGvD,iCAAiB,GAAjB,cAAoC,MAAM,CAAC,CAAC,CAAC;IAG7C,wBAAQ,GAAR,cAA2B,MAAM,CAAC,CAAC,CAAC;IAGpC,0BAAU,GAAV,cAA6B,MAAM,CAAC,CAAC,CAAC;IAGtC,6BAAa,GAAb,cAAgC,MAAM,CAAC,CAAC,CAAC;IAGzC,uBAAO,GAAP,UAAQ,MAAkB,IAAkB,MAAM,CAAC,CAAC,CAAC;IAGrD,uBAAO,GAAP,UAAQ,MAAkB,IAAkB,MAAM,CAAC,CAAC,CAAC;IAGrD,0BAAU,GAAV,UAAW,MAAkB,IAA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E;;;;qDACsC;IAGhD;QADC,OAAO,EAAE;;;;sDACiD;IAG3D;QADC,OAAO,EAAE;;;;yDACqD;IAG/D;QADC,OAAO,EAAE;;;;qDACuJ;IAGjK;QADC,OAAO,EAAE;;;;wDAC+D;IAGzE;QADC,OAAO,EAAE;;;;yDACuD;IAGjE;QADC,OAAO,EAAE;;;;kDACmC;IAG7C;QADC,OAAO,EAAE;;;;+CAC0G;IAGpH;QADC,OAAO,EAAE;;yCACY,KAAK;;4CAAuE;IAhJvF,KAAK;QAVjB,MAAM,CAAC;YACN,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,qBAAqB;YAChC,IAAI,EAAE,gDAAgD;YACtD,OAAO,EAAE,gFAAgF;YACzF,gBAAgB,EAAE,CAAC,SAAS,CAAC;YAC7B,SAAS,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC;SAC9B,CAAC;OAEW,KAAK,CAyJjB;IAAD,YAAC;CAzJD,AAyJC,CAzJ0B,iBAAiB,GAyJ3C;SAzJY,KAAK","file":"index.js","sourceRoot":"","sourcesContent":["import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';\nimport { Injectable } from '@angular/core';\n\nexport interface TagOptions {\n sequence: number;\n tags?: Array;\n}\n\nexport interface AliasOptions {\n sequence: number;\n alias?: string;\n}\n\n@Plugin({\n pluginName: 'JPush',\n plugin: 'jpush-phonegap-plugin',\n pluginRef: 'plugins.jPushPlugin',\n repo: 'https://github.com/jpush/jpush-phonegap-plugin',\n install: 'ionic cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_app_key',\n installVariables: ['APP_KEY'],\n platforms: ['Android', 'iOS']\n})\n\nexport class JPush extends IonicNativePlugin {\n\n @Cordova()\n init(): Promise { return; }\n\n @Cordova()\n setDebugMode(enable: boolean): Promise { return; }\n\n @Cordova()\n getRegistrationID(): Promise { return; }\n\n @Cordova()\n stopPush(): Promise { return; }\n\n @Cordova()\n resumePush(): Promise { return; }\n\n @Cordova()\n isPushStopped(): Promise { return; }\n\n @Cordova()\n setTags(params: TagOptions): Promise { return; }\n\n @Cordova()\n addTags(params: TagOptions): Promise { return; }\n\n @Cordova()\n deleteTags(params: TagOptions): Promise { return; }\n\n @Cordova()\n cleanTags(params: TagOptions): Promise { return; }\n\n @Cordova()\n getAllTags(params: TagOptions): Promise { return; }\n\n /**\n * @param params { sequence: number, tag: string }\n */\n @Cordova()\n checkTagBindState(params: object): Promise { return; }\n\n @Cordova()\n setAlias(params: AliasOptions): Promise { return; }\n\n @Cordova()\n deleteAlias(params: AliasOptions): Promise { return; }\n\n @Cordova()\n getAlias(params: AliasOptions): Promise { return; }\n\n /**\n * Determinate whether the application notification has been opened.\n * \n * iOS: 0: closed; >1: opened.\n * UIRemoteNotificationTypeNone = 0,\n * UIRemoteNotificationTypeBadge = 1 << 0,\n * UIRemoteNotificationTypeSound = 1 << 1,\n * UIRemoteNotificationTypeAlert = 1 << 2,\n * UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3\n * \n * Android: 0: closed; 1: opened.\n */\n @Cordova()\n getUserNotificationSettings(): Promise { return; }\n\n @Cordova()\n clearLocalNotifications(): Promise { return; }\n\n // iOS API - start\n\n @Cordova()\n setBadge(badge: number): Promise { return; }\n\n @Cordova()\n resetBadge(): Promise { return; }\n\n @Cordova()\n setApplicationIconBadgeNumber(badge: number): Promise { return; }\n\n @Cordova()\n getApplicationIconBadgeNumber(): Promise { return; }\n\n @Cordova()\n addLocalNotificationForIOS(delayTime: number, content: string, badge: number, notificationId: number, extras?: string): Promise { return; }\n\n @Cordova()\n deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: string): Promise { return; }\n\n @Cordova()\n addDismissActions(actions: Array, categoryId: string): Promise { return; }\n\n @Cordova()\n addNotificationActions(actions: Array, categoryId: string): Promise { return; }\n\n @Cordova()\n setLocation(latitude: number, longitude: number): Promise { return; }\n\n @Cordova()\n startLogPageView(pageName: string): Promise { return; }\n\n @Cordova()\n stopLogPageView(pageName: string): Promise { return; }\n\n @Cordova()\n beginLogPageView(pageName: string, duration: number): Promise { return; }\n\n // iOS API - end\n\n // Android API - start\n\n @Cordova()\n getConnectionState(): Promise { return; }\n\n @Cordova()\n setBasicPushNotificationBuilder(): Promise { return; }\n\n @Cordova()\n setCustomPushNotificationBuilder(): Promise { return; }\n\n @Cordova()\n clearAllNotification(): Promise { return; }\n\n @Cordova()\n clearNotificationById(id: number): Promise { return; }\n\n @Cordova()\n setLatestNotificationNum(num: number): Promise { return; }\n\n @Cordova()\n addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise { return; }\n\n @Cordova()\n removeLocalNotification(notificationId: number): Promise { return; }\n\n @Cordova()\n reportNotificationOpened(msgId: number): Promise { return; }\n\n @Cordova()\n requestPermission(): Promise { return; }\n\n @Cordova()\n setSilenceTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise { return; }\n\n @Cordova()\n setPushTime(weekdays: Array, startHour: number, endHour: number): Promise { return; }\n\n // Android API - end\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/** @nocollapse */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]} \ No newline at end of file diff --git a/ionic/jpush/index.metadata.json b/ionic/jpush/index.metadata.json new file mode 100644 index 0000000..2cc22fa --- /dev/null +++ b/ionic/jpush/index.metadata.json @@ -0,0 +1 @@ +[{"__symbolic":"module","version":3,"metadata":{"TagOptions":{"__symbolic":"interface"},"AliasOptions":{"__symbolic":"interface"},"JPush":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin"},"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","install":"ionic cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_app_key","installVariables":["APP_KEY"],"platforms":["Android","iOS"]}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"init":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setDebugMode":[{"__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"}}]}],"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"}}]}],"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"}}]}],"getUserNotificationSettings":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"clearLocalNotifications":[{"__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"}}]}],"resetBadge":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setApplicationIconBadgeNumber":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getApplicationIconBadgeNumber":[{"__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"}}]}],"deleteLocalNotificationWithIdentifierKeyInIOS":[{"__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"}}]}],"addNotificationActions":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setLocation":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"startLogPageView":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"stopLogPageView":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"beginLogPageView":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getConnectionState":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setBasicPushNotificationBuilder":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setCustomPushNotificationBuilder":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"clearAllNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"clearNotificationById":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setLatestNotificationNum":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addLocalNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"removeLocalNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"reportNotificationOpened":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"requestPermission":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setSilenceTime":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setPushTime":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"TagOptions":{"__symbolic":"interface"},"AliasOptions":{"__symbolic":"interface"},"JPush":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin"},"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","install":"ionic cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_app_key","installVariables":["APP_KEY"],"platforms":["Android","iOS"]}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"init":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setDebugMode":[{"__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"}}]}],"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"}}]}],"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"}}]}],"getUserNotificationSettings":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"clearLocalNotifications":[{"__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"}}]}],"resetBadge":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setApplicationIconBadgeNumber":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getApplicationIconBadgeNumber":[{"__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"}}]}],"deleteLocalNotificationWithIdentifierKeyInIOS":[{"__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"}}]}],"addNotificationActions":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setLocation":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"startLogPageView":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"stopLogPageView":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"beginLogPageView":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"getConnectionState":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setBasicPushNotificationBuilder":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setCustomPushNotificationBuilder":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"clearAllNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"clearNotificationById":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setLatestNotificationNum":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"addLocalNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"removeLocalNotification":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"reportNotificationOpened":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"requestPermission":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setSilenceTime":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}],"setPushTime":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@ionic-native/core","name":"Cordova"}}]}]}}}}] \ No newline at end of file diff --git a/ionic/jpush/jiguang-ionic-jpush-1.0.0.tgz b/ionic/jpush/jiguang-ionic-jpush-1.0.0.tgz new file mode 100644 index 0000000..fb6c166 Binary files /dev/null and b/ionic/jpush/jiguang-ionic-jpush-1.0.0.tgz differ diff --git a/ionic/jpush/package.json b/ionic/jpush/package.json new file mode 100644 index 0000000..879845e --- /dev/null +++ b/ionic/jpush/package.json @@ -0,0 +1,18 @@ +{ + "name": "@jiguang-ionic/jpush", + "version": "1.0.0", + "description": "JPush support for ionic-native", + "module": "index.js", + "typings": "index.d.ts", + "author": "hevin", + "license": "MIT", + "peerDependencies": { + "@ionic-native/core": "^4.2.0", + "@angular/core": "*", + "rxjs": "^5.0.1" + }, + "repository": { + "type": "git", + "url": "https://github.com/jpush/jpush-phonegap-plugin" + } +} diff --git a/src/android/JPushEventReceiver.java b/src/android/JPushEventReceiver.java index d69349c..1cc3035 100644 --- a/src/android/JPushEventReceiver.java +++ b/src/android/JPushEventReceiver.java @@ -96,6 +96,7 @@ public class JPushEventReceiver extends JPushMessageReceiver { } catch (JSONException e) { e.printStackTrace(); } + callback.success(resultJson); } else { try { @@ -103,7 +104,6 @@ public class JPushEventReceiver extends JPushMessageReceiver { } catch (JSONException e) { e.printStackTrace(); } - callback.error(resultJson); } diff --git a/src/ios/Plugins/JPushPlugin.m b/src/ios/Plugins/JPushPlugin.m index 64d3791..3e62c77 100644 --- a/src/ios/Plugins/JPushPlugin.m +++ b/src/ios/Plugins/JPushPlugin.m @@ -241,7 +241,7 @@ CDVPluginResult* result; if (iResCode == 0) { - [dic setObject:[iTags allObjects] forKey:@"tags"]; + dic[@"tag"] = tag; [dic setObject:[NSNumber numberWithBool:isBind] forKey:@"isBind"]; result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic]; } else {