mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-19 13:52:49 +08:00
Merge branch 'master' into dev
This commit is contained in:
commit
15c403a471
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[![Build Status](https://travis-ci.org/jpush/jpush-phonegap-plugin.svg?branch=master)](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
[![Build Status](https://travis-ci.org/jpush/jpush-phonegap-plugin.svg?branch=master)](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
||||||
[![QQ Group](https://img.shields.io/badge/QQ%20Group-413602425-red.svg)]()
|
[![QQ Group](https://img.shields.io/badge/QQ%20Group-413602425-red.svg)]()
|
||||||
[![release](https://img.shields.io/badge/release-3.1.0-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
[![release](https://img.shields.io/badge/release-3.1.3-blue.svg)](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||||
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-phonegap-plugin)
|
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jpush-phonegap-plugin)
|
||||||
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
||||||
|
|
||||||
|
76
package.json
76
package.json
@ -1,40 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "jpush-phonegap-plugin",
|
"name": "jpush-phonegap-plugin",
|
||||||
"version": "3.1.2",
|
"version": "3.1.3",
|
||||||
"description": "JPush for cordova plugin",
|
"description": "JPush for cordova plugin",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "jpush-phonegap-plugin",
|
"id": "jpush-phonegap-plugin",
|
||||||
"platforms": [
|
"platforms": [
|
||||||
"ios",
|
"ios",
|
||||||
"android"
|
"android"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/jpush/jpush-phonegap-plugin.git"
|
"url": "git+https://github.com/jpush/jpush-phonegap-plugin.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"JPush",
|
"JPush",
|
||||||
"push",
|
"push",
|
||||||
"Push",
|
"Push",
|
||||||
"ecosystem:cordova",
|
"ecosystem:cordova",
|
||||||
"cordova-ios",
|
"cordova-ios",
|
||||||
"cordova-android"
|
"cordova-android"
|
||||||
],
|
],
|
||||||
"engines": [
|
"engines": [{
|
||||||
{
|
"name": "cordova",
|
||||||
"name": "cordova",
|
"version": ">=3.0"
|
||||||
"version": ">=3.0"
|
}],
|
||||||
}
|
"peerDependencies": {
|
||||||
],
|
"cordova-plugin-device": ">=1.0.0",
|
||||||
"peerDependencies": {
|
"jcore-cordova-plugin": ">=1.1.1"
|
||||||
"cordova-plugin-device": ">=1.0.0",
|
},
|
||||||
"cordova-plugin-jcore": "1.1.1"
|
"author": "JiGuang",
|
||||||
},
|
"license": "MIT",
|
||||||
"author": "JiGuang",
|
"bugs": {
|
||||||
"license": "MIT",
|
"url": "https://github.com/jpush/jpush-phonegap-plugin/issues"
|
||||||
"bugs": {
|
},
|
||||||
"url": "https://github.com/jpush/jpush-phonegap-plugin/issues"
|
"homepage": "https://github.com/jpush/jpush-phonegap-plugin#readme"
|
||||||
},
|
}
|
||||||
"homepage": "https://github.com/jpush/jpush-phonegap-plugin#readme"
|
|
||||||
}
|
|
@ -2,7 +2,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="jpush-phonegap-plugin"
|
id="jpush-phonegap-plugin"
|
||||||
version="3.1.2">
|
version="3.1.3">
|
||||||
|
|
||||||
<name>JPush Plugin</name>
|
<name>JPush Plugin</name>
|
||||||
<description>JPush for cordova plugin</description>
|
<description>JPush for cordova plugin</description>
|
||||||
|
@ -28,29 +28,27 @@
|
|||||||
return [self init_plus];
|
return [self init_plus];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary *_launchOptions;
|
-(void)fireOpenNotification:(NSTimer*)timer{
|
||||||
|
if (SharedJPushPlugin) {
|
||||||
|
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[timer.userInfo toJsonString]];
|
||||||
|
[timer invalidate];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NSDictionary *_launchOptions;
|
||||||
-(void)applicationDidLaunch:(NSNotification *)notification{
|
-(void)applicationDidLaunch:(NSNotification *)notification{
|
||||||
|
|
||||||
|
|
||||||
if (notification) {
|
if (notification) {
|
||||||
if (notification.userInfo) {
|
if (notification.userInfo) {
|
||||||
NSDictionary *userInfo1 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
|
NSDictionary *userInfo1 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
|
||||||
if (userInfo1.count > 0) {
|
if (userInfo1.count > 0) {
|
||||||
[NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer * _Nonnull timer) {
|
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo1 repeats:YES];
|
||||||
if (SharedJPushPlugin) {
|
|
||||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[userInfo1 toJsonString]];
|
|
||||||
[timer invalidate];
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
|
NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
|
||||||
if (userInfo2.count > 0) {
|
if (userInfo2.count > 0) {
|
||||||
[NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer * _Nonnull timer) {
|
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo2 repeats:YES];
|
||||||
if (SharedJPushPlugin) {
|
|
||||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[userInfo2 toJsonString]];
|
|
||||||
[timer invalidate];
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[JPUSHService setDebugMode];
|
[JPUSHService setDebugMode];
|
||||||
@ -64,7 +62,6 @@ NSDictionary *_launchOptions;
|
|||||||
if (![delay boolValue]) {
|
if (![delay boolValue]) {
|
||||||
[self startJPushSDK];
|
[self startJPushSDK];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user