Merge branch 'master' into dev

This commit is contained in:
lhw5123 2017-03-29 15:30:05 +08:00
commit 15c403a471
4 changed files with 50 additions and 55 deletions

View File

@ -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)
[![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)
[![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)

View File

@ -1,6 +1,6 @@
{
"name": "jpush-phonegap-plugin",
"version": "3.1.2",
"version": "3.1.3",
"description": "JPush for cordova plugin",
"cordova": {
"id": "jpush-phonegap-plugin",
@ -21,15 +21,13 @@
"cordova-ios",
"cordova-android"
],
"engines": [
{
"engines": [{
"name": "cordova",
"version": ">=3.0"
}
],
}],
"peerDependencies": {
"cordova-plugin-device": ">=1.0.0",
"cordova-plugin-jcore": "1.1.1"
"jcore-cordova-plugin": ">=1.1.1"
},
"author": "JiGuang",
"license": "MIT",

View File

@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="jpush-phonegap-plugin"
version="3.1.2">
version="3.1.3">
<name>JPush Plugin</name>
<description>JPush for cordova plugin</description>

View File

@ -28,29 +28,27 @@
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{
if (notification) {
if (notification.userInfo) {
NSDictionary *userInfo1 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (userInfo1.count > 0) {
[NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer * _Nonnull timer) {
if (SharedJPushPlugin) {
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[userInfo1 toJsonString]];
[timer invalidate];
}
}];
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo1 repeats:YES];
}
NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (userInfo2.count > 0) {
[NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer * _Nonnull timer) {
if (SharedJPushPlugin) {
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[userInfo2 toJsonString]];
[timer invalidate];
}
}];
[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo2 repeats:YES];
}
}
[JPUSHService setDebugMode];
@ -64,7 +62,6 @@ NSDictionary *_launchOptions;
if (![delay boolValue]) {
[self startJPushSDK];
}
}
}