Skip to content

Commit ec6898f

Browse files
author
詹强
committed
ios-更新到JPush3.2.2
1 parent f7cb982 commit ec6898f

File tree

10 files changed

+425
-965
lines changed

10 files changed

+425
-965
lines changed

ios/RCTJPushModule.xcodeproj/project.pbxproj

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
624386D71E096B8800F69E07 /* RCTJPushActionQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 624386D21E096B8800F69E07 /* RCTJPushActionQueue.m */; };
10+
5CF8E64A231E3A9300B12200 /* jpush-ios-3.2.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CF8E648231E3A9300B12200 /* jpush-ios-3.2.2.a */; };
1111
624386D81E096B8800F69E07 /* RCTJPushModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 624386D41E096B8800F69E07 /* RCTJPushModule.m */; };
12-
62DA93BE21E8679300208462 /* libjpush-ios-3.1.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 62DA93BD21E8679300208462 /* libjpush-ios-3.1.2.a */; };
1312
/* End PBXBuildFile section */
1413

1514
/* Begin PBXCopyFilesBuildPhase section */
@@ -25,32 +24,39 @@
2524
/* End PBXCopyFilesBuildPhase section */
2625

2726
/* Begin PBXFileReference section */
28-
624386D11E096B8800F69E07 /* RCTJPushActionQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJPushActionQueue.h; sourceTree = "<group>"; };
29-
624386D21E096B8800F69E07 /* RCTJPushActionQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJPushActionQueue.m; sourceTree = "<group>"; };
27+
5CF8E648231E3A9300B12200 /* jpush-ios-3.2.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "jpush-ios-3.2.2.a"; path = "RCTJPushModule/jpush-ios-3.2.2.a"; sourceTree = "<group>"; };
3028
624386D31E096B8800F69E07 /* RCTJPushModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJPushModule.h; sourceTree = "<group>"; };
3129
624386D41E096B8800F69E07 /* RCTJPushModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJPushModule.m; sourceTree = "<group>"; };
3230
6280980A1CEDC407000D3A81 /* libRCTJPushModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTJPushModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
3331
62DA93BC21E8679300208462 /* JPUSHService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JPUSHService.h; sourceTree = "<group>"; };
34-
62DA93BD21E8679300208462 /* libjpush-ios-3.1.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libjpush-ios-3.1.2.a"; sourceTree = "<group>"; };
3532
/* End PBXFileReference section */
3633

3734
/* Begin PBXFrameworksBuildPhase section */
3835
628098071CEDC407000D3A81 /* Frameworks */ = {
3936
isa = PBXFrameworksBuildPhase;
4037
buildActionMask = 2147483647;
4138
files = (
42-
62DA93BE21E8679300208462 /* libjpush-ios-3.1.2.a in Frameworks */,
39+
5CF8E64A231E3A9300B12200 /* jpush-ios-3.2.2.a in Frameworks */,
4340
);
4441
runOnlyForDeploymentPostprocessing = 0;
4542
};
4643
/* End PBXFrameworksBuildPhase section */
4744

4845
/* Begin PBXGroup section */
46+
5CF8E647231E3A9200B12200 /* Frameworks */ = {
47+
isa = PBXGroup;
48+
children = (
49+
5CF8E648231E3A9300B12200 /* jpush-ios-3.2.2.a */,
50+
);
51+
name = Frameworks;
52+
sourceTree = "<group>";
53+
};
4954
628098011CEDC407000D3A81 = {
5055
isa = PBXGroup;
5156
children = (
5257
6280980C1CEDC407000D3A81 /* RCTJPushModule */,
5358
6280980B1CEDC407000D3A81 /* Products */,
59+
5CF8E647231E3A9200B12200 /* Frameworks */,
5460
);
5561
sourceTree = "<group>";
5662
};
@@ -66,9 +72,6 @@
6672
isa = PBXGroup;
6773
children = (
6874
62DA93BC21E8679300208462 /* JPUSHService.h */,
69-
62DA93BD21E8679300208462 /* libjpush-ios-3.1.2.a */,
70-
624386D11E096B8800F69E07 /* RCTJPushActionQueue.h */,
71-
624386D21E096B8800F69E07 /* RCTJPushActionQueue.m */,
7275
624386D31E096B8800F69E07 /* RCTJPushModule.h */,
7376
624386D41E096B8800F69E07 /* RCTJPushModule.m */,
7477
);
@@ -114,6 +117,7 @@
114117
developmentRegion = English;
115118
hasScannedForEncodings = 0;
116119
knownRegions = (
120+
English,
117121
en,
118122
);
119123
mainGroup = 628098011CEDC407000D3A81;
@@ -132,7 +136,6 @@
132136
buildActionMask = 2147483647;
133137
files = (
134138
624386D81E096B8800F69E07 /* RCTJPushModule.m in Sources */,
135-
624386D71E096B8800F69E07 /* RCTJPushActionQueue.m in Sources */,
136139
);
137140
runOnlyForDeploymentPostprocessing = 0;
138141
};

ios/RCTJPushModule/JPUSHService.h

100755100644
Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
1010
*/
1111

12-
#define JPUSH_VERSION_NUMBER 3.1.2
12+
#define JPUSH_VERSION_NUMBER 3.2.2
1313

1414
#import <Foundation/Foundation.h>
1515

@@ -148,12 +148,6 @@ typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
148148
/// @name Setup 启动相关
149149
///----------------------------------------------------
150150

151-
/*!
152-
* @abstract 启动SDK
153-
*
154-
* @discussion 这是旧版本的启动方法, 依赖于 PushConfig.plist 文件. 建议不要使用, 已经过期.
155-
*/
156-
+ (void)setupWithOption:(NSDictionary *)launchingOption __attribute__((deprecated("JPush 2.1.0 版本已过期")));
157151

158152
/*!
159153
* @abstract 启动SDK
@@ -163,7 +157,6 @@ typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
163157
* @param channel 发布渠道. 可选.
164158
* @param isProduction 是否生产环境. 如果为开发状态,设置为 NO; 如果为生产状态,应改为 YES.
165159
* App 证书环境取决于profile provision的配置,此处建议与证书环境保持一致.
166-
* @param advertisingIdentifier 广告标识符(IDFA) 如果不需要使用IDFA,传nil.
167160
*
168161
* @discussion 提供SDK启动必须的参数, 来启动 SDK.
169162
* 此接口必须在 App 启动时调用, 否则 JPush SDK 将无法正常工作.
@@ -173,7 +166,19 @@ typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
173166
channel:(NSString *)channel
174167
apsForProduction:(BOOL)isProduction;
175168

176-
169+
/*!
170+
* @abstract 启动SDK
171+
*
172+
* @param launchingOption 启动参数.
173+
* @param appKey 一个JPush 应用必须的,唯一的标识. 请参考 JPush 相关说明文档来获取这个标识.
174+
* @param channel 发布渠道. 可选.
175+
* @param isProduction 是否生产环境. 如果为开发状态,设置为 NO; 如果为生产状态,应改为 YES.
176+
* App 证书环境取决于profile provision的配置,此处建议与证书环境保持一致.
177+
* @param advertisingId 广告标识符(IDFA) 如果不需要使用IDFA,传nil.
178+
*
179+
* @discussion 提供SDK启动必须的参数, 来启动 SDK.
180+
* 此接口必须在 App 启动时调用, 否则 JPush SDK 将无法正常工作.
181+
*/
177182
+ (void)setupWithOption:(NSDictionary *)launchingOption
178183
appKey:(NSString *)appKey
179184
channel:(NSString *)channel
@@ -385,6 +390,13 @@ typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
385390
*/
386391
+ (void)registerLbsGeofenceDelegate:(id<JPUSHGeofenceDelegate>)delegate withLaunchOptions:(NSDictionary *)launchOptions;
387392

393+
/**
394+
删除地理围栏
395+
396+
@param geofenceId 地理围栏id
397+
*/
398+
+ (void)removeGeofenceWithIdentifier:(NSString *)geofenceId;
399+
388400
///----------------------------------------------------
389401
/// @name Local Notification 本地通知
390402
///----------------------------------------------------
@@ -640,14 +652,14 @@ callbackSelector:(SEL)cbSelector
640652
* @param response 通知响应对象
641653
* @param completionHandler
642654
*/
643-
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler;
655+
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler;
644656

645657
/*
646658
* @brief handle UserNotifications.framework [openSettingsForNotification:]
647659
* @param center [UNUserNotificationCenter currentNotificationCenter] 新特性用户通知中心
648660
* @param notification 当前管理的通知对象
649661
*/
650-
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center openSettingsForNotification:(nullable UNNotification *)notification NS_AVAILABLE_IOS(12.0);
662+
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center openSettingsForNotification:(UNNotification *)notification NS_AVAILABLE_IOS(12.0);
651663

652664
@end
653665

@@ -660,7 +672,7 @@ callbackSelector:(SEL)cbSelector
660672
@param userInfo 地理围栏触发时返回的信息
661673
@param error 错误信息
662674
*/
663-
- (void)jpushGeofenceIdentifer:(NSString * _Nonnull)geofenceId didEnterRegion:(NSDictionary * _Nullable)userInfo error:(NSError * _Nullable)error;
675+
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didEnterRegion:(NSDictionary *)userInfo error:(NSError *)error;
664676

665677
/**
666678
离开地理围栏区域
@@ -669,6 +681,6 @@ callbackSelector:(SEL)cbSelector
669681
@param userInfo 地理围栏触发时返回的信息
670682
@param error 错误信息
671683
*/
672-
- (void)jpushGeofenceIdentifer:(NSString * _Nonnull)geofenceId didExitRegion:(NSDictionary * _Nullable)userInfo error:(NSError * _Nullable)error;
684+
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didExitRegion:(NSDictionary *)userInfo error:(NSError *)error;
673685

674686
@end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* | | | | \ \ / / | | | | / _______|
3+
* | |____| | \ \/ / | |____| | / /
4+
* | |____| | \ / | |____| | | | _____
5+
* | | | | / \ | | | | | | |____ |
6+
* | | | | / /\ \ | | | | \ \______| |
7+
* | | | | /_/ \_\ | | | | \_________|
8+
*
9+
* Copyright (c) 2017 Shenzhen HXHG. All rights reserved.
10+
*/
11+
12+
#import <Foundation/Foundation.h>
13+
14+
#define JPUSH_EXTENSION_VERSION_NUMBER 1.1.2
15+
16+
@class UNNotificationRequest;
17+
18+
@interface JPushNotificationExtensionService : NSObject
19+
20+
21+
/**
22+
设置appkey(需要与main target中的appkey相同)
23+
*/
24+
+ (void)jpushSetAppkey:(NSString *)appkey;
25+
26+
/**
27+
apns送达
28+
@param request apns请求
29+
@param completion 回调
30+
*/
31+
+ (void)jpushReceiveNotificationRequest:(UNNotificationRequest *)request with:(void (^)(void))completion;
32+
33+
/**
34+
关闭日志
35+
默认为开启
36+
建议发布时关闭以减少不必要的IO
37+
*/
38+
+ (void)setLogOff;
39+
40+
41+
@end

ios/RCTJPushModule/RCTJPushActionQueue.h

Lines changed: 0 additions & 26 deletions
This file was deleted.

ios/RCTJPushModule/RCTJPushActionQueue.m

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
//
2-
// JPushHelper.h
3-
// PushDemo
4-
//
5-
// Created by oshumini on 16/3/14.
6-
// Copyright © 2016年 Facebook. All rights reserved.
7-
//
8-
91
#import <Foundation/Foundation.h>
102

11-
#if __has_include(<React/RCTBridgeModule.h>)
12-
#import <React/RCTBridgeModule.h>
13-
#elif __has_include("RCTBridgeModule.h")
14-
#import "RCTBridgeModule.h"
15-
#elif __has_include("React/RCTBridgeModule.h")
16-
#import "React/RCTBridgeModule.h"
3+
#if __has_include(<React/RCTBridge.h>)
4+
#import <React/RCTEventEmitter.h>
5+
#import <React/RCTRootView.h>
6+
#import <React/RCTBridge.h>
7+
#elif __has_include("RCTBridge.h")
8+
#import "RCTEventEmitter.h"
9+
#import "RCTRootView.h"
10+
#import "RCTBridge.h"
1711
#endif
1812

1913
#import "JPUSHService.h"
2014

21-
#define kJPFDidReceiveRemoteNotification @"kJPFDidReceiveRemoteNotification"
22-
23-
#define kJPFOpenNotification @"kJPFOpenNotification" // 通过点击通知事件
24-
#define kJPFOpenNotificationToLaunchApp @"kJPFOpenNotificationToLaunchApp" // 通过点击通知启动应用
15+
#define J_APNS_NOTIFICATION_ARRIVED_EVENT @"J_APNS_NOTIFICATION_ARRIVED_EVENT"
16+
#define J_APNS_NOTIFICATION_OPENED_EVENT @"J_APNS_NOTIFICATION_OPENED_EVENT"
17+
#define J_CUSTOM_NOTIFICATION_EVENT @"J_CUSTOM_NOTIFICATION_EVENT"
18+
#define J_LOCAL_NOTIFICATION_EVENT @"J_LOCAL_NOTIFICATION_EVENT"
2519

26-
@interface RCTJPushModule : NSObject <RCTBridgeModule, JPUSHRegisterDelegate>
27-
@property(strong,nonatomic)RCTResponseSenderBlock asyCallback;
20+
@interface RCTJPushModule : RCTEventEmitter <RCTBridgeModule>
2821

29-
- (void)didRegistRemoteNotification:(NSString *)token;
3022
@end

0 commit comments

Comments
 (0)