New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ionic2-jpush

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ionic2-jpush - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.npmignore

4

dist/index.d.ts

@@ -0,1 +1,5 @@

/**
* Created by hsuanlee on 2017/1/22.
*/
export { JPushService } from './plugin-jpush.service';
export { IonJPushModule } from './jpush.module';

8

dist/index.js

@@ -1,4 +0,6 @@

"use strict";
var plugin_jpush_service_1 = require("./plugin-jpush.service");
exports.JPushService = plugin_jpush_service_1.JPushService;
/**
* Created by hsuanlee on 2017/1/22.
*/
export { JPushService } from './plugin-jpush.service';
export { IonJPushModule } from './jpush.module';
//# sourceMappingURL=index.js.map

@@ -8,16 +8,16 @@ import { Observable } from 'rxjs/Rx';

wrapEventObservable(event: string): Observable<any>;
init(): any;
getRegistrationID(): any;
stopPush(): any;
resumePush(): any;
isPushStopped(): any;
setTagsWithAlias(tags: Array<any>, alias: string): any;
setTags(tags: Array<any>): any;
setAlias(alias: string): any;
setBadge(value: number): any;
reSetBadge(): any;
setApplicationIconBadgeNumber(value: number): any;
getApplicationIconBadgeNumber(): any;
clearNotificationById(id: number): any;
clearAllNotification(): any;
init(): Promise<{}>;
getRegistrationID(): Promise<{}>;
stopPush(): Promise<{}>;
resumePush(): Promise<{}>;
isPushStopped(): Promise<{}>;
setTagsWithAlias(tags: Array<any>, alias: string): Promise<{}>;
setTags(tags: Array<any>): Promise<{}>;
setAlias(alias: string): Promise<{}>;
setBadge(value: number): Promise<{}>;
reSetBadge(): Promise<{}>;
setApplicationIconBadgeNumber(value: number): Promise<{}>;
getApplicationIconBadgeNumber(): Promise<{}>;
clearNotificationById(id: number): Promise<{}>;
clearAllNotification(): Promise<{}>;
openNotification(): any;

@@ -24,0 +24,0 @@ receiveNotification(): any;

@@ -1,2 +0,1 @@

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -8,9 +7,5 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require("@angular/core");
var Rx_1 = require("rxjs/Rx");
var ionic_angular_1 = require("ionic-angular");
var JPushService = (function () {
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Rx';
export var JPushService = (function () {
function JPushService(platform) {

@@ -21,3 +16,3 @@ this.platform = platform;

JPushService.prototype.wrapEventObservable = function (event) {
return new Rx_1.Observable(function (observer) {
return new Observable(function (observer) {
document.addEventListener(event, observer.next.bind(observer), false);

@@ -44,7 +39,7 @@ return function () { return document.removeEventListener(event, observer.next.bind(observer), false); };

_this.jPushPlugin.getRegistrationID(function (id) {
if (id !== 0) {
if (id) {
resolve(id);
}
else {
reject('失败');
reject('获取ID失败');
}

@@ -104,3 +99,3 @@ });

if (_this.jPushPlugin) {
_this.jPushPlugin.prototype.setTagsWithAlias(tags, alias);
_this.jPushPlugin.setTagsWithAlias(tags, alias);
resolve('ok');

@@ -117,3 +112,3 @@ }

if (_this.jPushPlugin) {
_this.jPushPlugin.prototype.setTags(tags);
_this.jPushPlugin.setTags(tags);
resolve('ok');

@@ -130,3 +125,3 @@ }

if (_this.jPushPlugin) {
_this.jPushPlugin.prototype.setAlias(alias);
_this.jPushPlugin.setAlias(alias);
resolve('ok');

@@ -144,3 +139,3 @@ }

if (_this.platform.is('ios')) {
_this.jPushPlugin.prototype.setBadge(value);
_this.jPushPlugin.setBadge(value);
resolve('ok');

@@ -162,3 +157,3 @@ }

if (_this.platform.is('ios')) {
_this.jPushPlugin.prototype.reSetBadge();
_this.jPushPlugin.reSetBadge();
resolve('ok');

@@ -180,3 +175,3 @@ }

if (_this.platform.is('ios')) {
_this.jPushPlugin.prototype.setApplicationIconBadgeNumber(value);
_this.jPushPlugin.setApplicationIconBadgeNumber(value);
resolve('ok');

@@ -198,3 +193,3 @@ }

if (_this.platform.is('ios')) {
_this.jPushPlugin.prototype.getApplicationIconBadgeNumber(function (num) {
_this.jPushPlugin.getApplicationIconBadgeNumber(function (num) {
resolve(num);

@@ -258,10 +253,7 @@ });

};
JPushService = __decorate([
Injectable()
], JPushService);
return JPushService;
}());
JPushService = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [typeof (_a = typeof ionic_angular_1.Platform !== "undefined" && ionic_angular_1.Platform) === "function" && _a || Object])
], JPushService);
exports.JPushService = JPushService;
var _a;
//# sourceMappingURL=plugin-jpush.service.js.map
{
"name": "ionic2-jpush",
"version": "0.0.2",
"description": "ionic2 ",
"version": "0.0.3",
"description": "ionic2 jPush",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"ngc": "ngc",
"test": "echo \"Error: no test specified\" && exit 1",
"build":"tsc"
"build": "rm -rf aot dist && npm run ngc"
},

@@ -14,2 +16,18 @@ "repository": {

},
"devDependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@types/core-js": "^0.9.35",
"ionic-angular": "2.0.0",
"rxjs": "5.0.0-beta.12",
"typescript": "2.0.9",
"zone.js": "0.6.26"
},
"keywords": [

@@ -16,0 +34,0 @@ "ionic2",

# ionic2-JPush
[![Dependency Status](https://david-dm.org/HsuanXyz/ionic2-jpush.svg)](https://david-dm.org/HsuanXyz/ionic2-jpush)
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][downloads-url] [![MIT License][license-image]][license-url]
为ionic2调用极光插件提供符合angular2及TS的调用方式
说在前面:如果想使用 ionic-native 的调用方式,可以参考https://github.com/zjcboy/ionic2-jpush-demo
### install
先安装官方的cordova插件
先安装官方的cordova插件 https://github.com/jpush/jpush-phonegap-plugin.git

@@ -13,4 +19,33 @@ `$ cordova plugin add jpush-phonegap-plugin --variable APP_KEY=your_jpush_appkey`

### use
### Import module
```
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
...
import { IonJPushModule } from 'ionic2-jpush'
@NgModule({
declarations: [
MyApp,
...
],
imports: [
IonJPushModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
...
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class AppModule {}
```
### Use
```javascript

@@ -21,7 +56,6 @@ import 'rxjs';

...
import { JPushService } from 'ionic2-jpush/dist'
import { JPushService } from 'ionic2-jpush'
@Component({
templateUrl: 'plugins-test.html',
providers : [JPushService]
templateUrl: 'plugins-test.html'

@@ -83,3 +117,2 @@ })

# API

@@ -106,12 +139,10 @@ | 名称 | 参数 | 返回类型 | 描述 |

| backgroundNotification | 无| Observable | 后台收到通知事件 |
# Environment
```
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.2.1 Build version 8C1002
```
[npm-url]: https://www.npmjs.com/package/ionic2-jpush
[npm-image]: https://img.shields.io/npm/v/ionic2-jpush.svg
[downloads-image]: https://img.shields.io/npm/dm/ionic2-jpush.svg
[downloads-url]: http://badge.fury.io/js/ionic2-jpush
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: LICENSE

@@ -5,1 +5,2 @@ /**

export { JPushService } from './plugin-jpush.service';
export { IonJPushModule } from './jpush.module';

@@ -8,4 +8,4 @@ /**

declare var window;
declare var document;
declare var plugins:any;
declare var document:any;

@@ -17,6 +17,7 @@ @Injectable()

constructor ( private platform: Platform,) {}
constructor ( private platform: Platform,) {
}
wrapEventObservable(event: string): Observable<any> {
return new Observable(observer => {
return new Observable( (observer:any) => {
document.addEventListener(event, observer.next.bind(observer), false);

@@ -28,2 +29,3 @@ return () => document.removeEventListener(event, observer.next.bind(observer), false);

init() {
return new Promise((resolve,reject) =>{

@@ -45,7 +47,7 @@

if(this.jPushPlugin){
this.jPushPlugin.getRegistrationID( id => {
if(id !== 0 ){
this.jPushPlugin.getRegistrationID( (id:any) => {
if(id){
resolve(id)
}else{
reject('失败')
reject('获取ID失败')
}

@@ -91,3 +93,3 @@ } )

if(this.jPushPlugin){
this.jPushPlugin.isPushStopped( result => {
this.jPushPlugin.isPushStopped( (result:any) => {
if(result === 0 ){

@@ -110,3 +112,3 @@ resolve(true)

if(this.jPushPlugin){
this.jPushPlugin.prototype.setTagsWithAlias(tags,alias);
this.jPushPlugin.setTagsWithAlias(tags,alias);
resolve('ok')

@@ -122,3 +124,3 @@ }else {

if(this.jPushPlugin){
this.jPushPlugin.prototype.setTags(tags);
this.jPushPlugin.setTags(tags);
resolve('ok')

@@ -134,3 +136,3 @@ }else {

if(this.jPushPlugin){
this.jPushPlugin.prototype.setAlias(alias);
this.jPushPlugin.setAlias(alias);
resolve('ok')

@@ -148,3 +150,3 @@ }else {

if(this.platform.is('ios')){
this.jPushPlugin.prototype.setBadge(value);
this.jPushPlugin.setBadge(value);
resolve('ok')

@@ -166,3 +168,3 @@ }else {

if(this.platform.is('ios')){
this.jPushPlugin.prototype.reSetBadge();
this.jPushPlugin.reSetBadge();
resolve('ok')

@@ -184,3 +186,3 @@ }else {

if (this.platform.is('ios')) {
this.jPushPlugin.prototype.setApplicationIconBadgeNumber(value);
this.jPushPlugin.setApplicationIconBadgeNumber(value);
resolve('ok')

@@ -202,3 +204,3 @@ } else {

if(this.platform.is('ios')){
this.jPushPlugin.prototype.getApplicationIconBadgeNumber( num => {
this.jPushPlugin.getApplicationIconBadgeNumber( (num:any) => {
resolve(num)

@@ -205,0 +207,0 @@ } )

{
"compilerOptions": {
"module": "es2015",
"target": "es5",
"moduleResolution": "node",
"sourceMap": true,
"declaration": true,
"noImplicitAny": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"removeComments": true,
"sourceMap": true,
"target": "es5"
"lib": ["dom", "es2015"],
"outDir": "./dist"
},
"files": [
"src/plugin-jpush.service.ts",
"src/index.ts"
],
"exclude": [
"node_modules"
"node_modules",
"dist"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
"angularCompilerOptions": {
"genDir": "aot"
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc