mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2026-04-19 00:03:45 +08:00
Merge branch 'master' into dev
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
[](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
||||||
[]()
|
[]()
|
||||||
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||||
[](https://github.com/jpush/jpush-phonegap-plugin)
|
[](https://github.com/jpush/jpush-phonegap-plugin)
|
||||||
[](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
[](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
||||||
|
|
||||||
|
|||||||
+4
-6
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"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",
|
||||||
@@ -21,15 +21,13 @@
|
|||||||
"cordova-ios",
|
"cordova-ios",
|
||||||
"cordova-android"
|
"cordova-android"
|
||||||
],
|
],
|
||||||
"engines": [
|
"engines": [{
|
||||||
{
|
|
||||||
"name": "cordova",
|
"name": "cordova",
|
||||||
"version": ">=3.0"
|
"version": ">=3.0"
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"cordova-plugin-device": ">=1.0.0",
|
"cordova-plugin-device": ">=1.0.0",
|
||||||
"cordova-plugin-jcore": "1.1.1"
|
"jcore-cordova-plugin": ">=1.1.1"
|
||||||
},
|
},
|
||||||
"author": "JiGuang",
|
"author": "JiGuang",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
+1
-1
@@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user