iOS - update

1.增加本地通知事件
2.更新 doc
3.fix bug
This commit is contained in:
pikacode
2016-12-06 13:56:27 +08:00
parent 7ca29c3397
commit 309131e944
6 changed files with 335 additions and 164 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
// AppDelegate+JPush.h
// delegateExtention
//
// Created by pikacode@qq.com on 15/8/3.
// Created by 张庆贺 on 15/8/3.
// Copyright (c) 2015年 JPush. All rights reserved.
//
+4 -6
View File
@@ -2,7 +2,7 @@
// AppDelegate+JPush.m
// delegateExtention
//
// Created by pikacode@qq.com on 15/8/3.
// Created by 张庆贺 on 15/8/3.
// Copyright (c) 2015年 JPush. All rights reserved.
//
@@ -28,8 +28,6 @@
return [self init_plus];
}
-(void)applicationDidLaunch:(NSNotification *)notification{
if (notification) {
if (notification.userInfo) {
@@ -39,7 +37,7 @@
}
NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (userInfo2.count > 0) {
[SharedJPushPlugin jpushFireDocumentEvent:JPushDocumentEvent_OpenLocalNotification jsString:[userInfo1 toJsonString]];
[SharedJPushPlugin jpushFireDocumentEvent:JPushDocumentEvent_StartLocalNotification jsString:[userInfo1 toJsonString]];
}
}
[JPUSHService setDebugMode];
@@ -91,7 +89,7 @@
eventName = JPushDocumentEvent_ReceiveNotification;
break;
case UIApplicationStateBackground:
eventName = JPushDocumentEvent_BackgoundNotification;
eventName = JPushDocumentEvent_BackgroundNotification;
break;
default:
break;
@@ -117,7 +115,7 @@
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
// [[NSNotificationCenter defaultCenter] postNotificationName:kJPushPluginReceiveLocalNotification object:notification.userInfo];
[[NSNotificationCenter defaultCenter] postNotificationName:JPushDocumentEvent_ReceiveLocalNotification object:notification.userInfo];
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
+8 -7
View File
@@ -2,7 +2,7 @@
// ConstantDef.h
// jmessage
//
// Created by pikacode@qq.com on 16/1/19.
// Created by ljg on 16/1/19.
//
//
@@ -21,11 +21,12 @@ static NSString *const JPushConfig_IsProduction = @"IsProduction";
static NSString *const JPushConfig_IsIDFA = @"IsIDFA";
static NSString *const JPushConfig_FileName = @"PushConfig";
static NSString *const JPushDocumentEvent_ReceiveNotification = @"receiveNotification";
static NSString *const JPushDocumentEvent_OpenNotification = @"openNotification";
static NSString *const JPushDocumentEvent_BackgoundNotification = @"backgoundNotification";
static NSString *const JPushDocumentEvent_SetTagsWithAlias = @"setTagsWithAlias";
static NSString *const JPushDocumentEvent_ReceiveMessage = @"receiveMessage";
static NSString *const JPushDocumentEvent_OpenLocalNotification = @"openLocalNotification";
static NSString *const JPushDocumentEvent_ReceiveNotification = @"receiveNotification";
static NSString *const JPushDocumentEvent_OpenNotification = @"openNotification";
static NSString *const JPushDocumentEvent_BackgroundNotification = @"backgroundNotification";
static NSString *const JPushDocumentEvent_SetTagsWithAlias = @"setTagsWithAlias";
static NSString *const JPushDocumentEvent_ReceiveMessage = @"receiveMessage";
static NSString *const JPushDocumentEvent_StartLocalNotification = @"startLocalNotification";
static NSString *const JPushDocumentEvent_ReceiveLocalNotification = @"receiveLocalNotification";
+1 -1
View File
@@ -2,7 +2,7 @@
// PushTalkPlugin.h
// PushTalk
//
// Created by pikacode@qq.com on 13-12-13.
// Created by zhangqinghe on 13-12-13.
//
//
+3 -3
View File
@@ -2,7 +2,7 @@
// PushTalkPlugin.m
// PushTalk
//
// Created by pikacode@qq.com on 13-12-13.
// Created by zhangqinghe on 13-12-13.
//
//
@@ -164,7 +164,7 @@
NSNumber *badge = [command argumentAtIndex:2];
NSString *idKey = [command argumentAtIndex:3];
NSDictionary *dict = [command argumentAtIndex:4];
[JPUSHService setLocalNotification:date alertBody:alert badge:badge alertAction:nil identifierKey:idKey userInfo:dict soundName:nil];
[JPUSHService setLocalNotification:date alertBody:alert badge:badge.intValue alertAction:nil identifierKey:idKey userInfo:dict soundName:nil];
}
-(void)deleteLocalNotificationWithIdentifierKey:(CDVInvokedUrlCommand*)command{
@@ -266,7 +266,7 @@
NSNumber *isIDFA = [plistData valueForKey:JPushConfig_IsIDFA];
NSString *advertisingId = nil;
if(isIDFA){
if(isIDFA.boolValue){
advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
}
[JPUSHService setupWithOption:userInfo