Skip to content

Commit cd028ed

Browse files
authored
Merge pull request #961 from huangshuni/master
ios SDK更新到5.4.0版本
2 parents 36a8f77 + 7f6318f commit cd028ed

File tree

11 files changed

+90
-6
lines changed

11 files changed

+90
-6
lines changed

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ PODS:
77
- hermes-engine (0.74.1):
88
- hermes-engine/Pre-built (= 0.74.1)
99
- hermes-engine/Pre-built (0.74.1)
10-
- JCore (2.1.3):
10+
- JCore (2.2.1):
1111
- React
12-
- JPush (3.0.6):
12+
- JPush (3.1.0):
1313
- React
1414
- RCT-Folly (2024.01.01.00):
1515
- boost
@@ -1357,8 +1357,8 @@ SPEC CHECKSUMS:
13571357
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
13581358
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
13591359
hermes-engine: 16b8530de1b383cdada1476cf52d1b52f0692cbc
1360-
JCore: c6fd1de888e399343d1a04b836e541dbc5023dcc
1361-
JPush: 84890a94022a328f79291ee20891042c53c1ec3f
1360+
JCore: 27d0cde74c2136d95ff6e5462dd3cce3838acf52
1361+
JPush: 30e91a659b857338102cd88f21cc1dd6cb023fde
13621362
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
13631363
RCTDeprecation: efb313d8126259e9294dc4ee0002f44a6f676aba
13641364
RCTRequired: f49ea29cece52aee20db633ae7edc4b271435562

index.d.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,4 +493,27 @@ export default class JPush {
493493
*/
494494
appBadge: number;
495495
}): void;
496+
497+
/**
498+
* 设置用户分群推送功能开关
499+
*
500+
*
501+
* @param {boolean} enable, YES:开启,NO:关闭,默认是开启。
502+
*
503+
*/
504+
static setSmartPushEnable(enable: boolean): void;
505+
506+
/**
507+
* 数据采集控制, YES:开启,NO:关闭, 默认开启
508+
*
509+
*/
510+
static setCollectControl(params: {
511+
cell: boolean;
512+
bssid: boolean;
513+
imei: boolean;
514+
imsi: boolean;
515+
mac: boolean;
516+
wifi: boolean;
517+
}): void;
518+
496519
}

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ export default class JPush {
725725
}
726726
static setSmartPushEnable(enable) {
727727
if (Platform.OS == "ios") {
728+
JPushModule.setSmartPushEnable(enable)
728729
}else if (Platform.OS == "android") {
729730
JPushModule.setSmartPushEnable(enable)
730731
}
@@ -738,6 +739,7 @@ export default class JPush {
738739

739740
static setCollectControl(params) {
740741
if (Platform.OS == "ios") {
742+
JPushModule.setCollectControl(params)
741743
}else if (Platform.OS == "android") {
742744
JPushModule.setCollectControl(params)
743745
}

ios/RCTJPushModule/RCTJPushModule.m

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,39 @@ - (id)init
351351
[JPUSHService pageLeave:pageName];
352352
}
353353

354+
// 合规
355+
RCT_EXPORT_METHOD(setCollectControl:(NSDictionary *)params)
356+
{
357+
JPushCollectControl *control = [[JPushCollectControl alloc] init];
358+
BOOL gps = YES;
359+
BOOL cell = YES;
360+
BOOL bssid = YES;
361+
BOOL ssid = YES;
362+
if (params[@"gps"] && [params[@"gps"] isKindOfClass:[NSNumber class]]) {
363+
gps = [params[@"gps"] boolValue];
364+
}
365+
if (params[@"cell"] && [params[@"cell"] isKindOfClass:[NSNumber class]]) {
366+
cell = [params[@"cell"] boolValue];
367+
}
368+
if (params[@"bssid"] && [params[@"bssid"] isKindOfClass:[NSNumber class]]) {
369+
bssid = [params[@"bssid"] boolValue];
370+
}
371+
if (params[@"ssid"] && [params[@"ssid"] isKindOfClass:[NSNumber class]]) {
372+
ssid = [params[@"ssid"] boolValue];
373+
}
374+
control.gps = gps;
375+
control.cell = cell;
376+
control.bssid = bssid;
377+
control.ssid = ssid;
378+
[JPUSHService setCollectControl:control];
379+
}
380+
381+
RCT_EXPORT_METHOD(setSmartPushEnable:(BOOL *)enable)
382+
{
383+
[JPUSHService setSmartPushEnable:enable];
384+
}
385+
386+
354387
//应用内消息 代理
355388
- (void)jPushInAppMessageDidShow:(JPushInAppMessage *)inAppMessage {
356389
NSDictionary *responseData = [self convertInappMsg:inAppMessage isShow:YES];

ios/RCTJPushModule/jpush-ios-5.3.0.xcframework/ios-arm64/Headers/JPUSHService.h renamed to ios/RCTJPushModule/jpush-ios-5.4.0.xcframework/ios-arm64/Headers/JPUSHService.h

Lines changed: 14 additions & 1 deletion
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 5.3.0
12+
#define JPUSH_VERSION_NUMBER 5.4.0
1313

1414
#import <Foundation/Foundation.h>
1515

@@ -177,6 +177,12 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
177177

178178
@interface JPushCollectControl : NSObject
179179

180+
/* ssid SSID信息。设置为NO,不采集SSID信息。默认为YES。 */
181+
@property (nonatomic, assign) BOOL ssid;
182+
/* bssid BSSID信息。设置为NO,不采集BSSID信息。默认为YES。 */
183+
@property (nonatomic, assign) BOOL bssid;
184+
/* cell 基站信息。设置为NO,不采集基站信息。默认为YES。*/
185+
@property (nonatomic, assign) BOOL cell;
180186
/* gps 经纬度信息。设置为NO,不采集经纬度信息。默认为YES。 */
181187
@property (nonatomic, assign) BOOL gps;
182188

@@ -793,6 +799,13 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
793799
*/
794800
+ (void)setPushEnable:(BOOL)isEnable completion:(nullable void (^)(NSInteger iResCode))completion;
795801

802+
/*!
803+
* @abstract 设置用户分群推送功能开关
804+
*
805+
* @param isEnable YES:开启,NO:关闭,默认是开启。
806+
*
807+
*/
808+
+ (void)setSmartPushEnable:(BOOL)isEnable;
796809

797810
/*!
798811
* @abstract 设置应用内提醒消息的代理
Lines changed: 14 additions & 1 deletion
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 5.3.0
12+
#define JPUSH_VERSION_NUMBER 5.4.0
1313

1414
#import <Foundation/Foundation.h>
1515

@@ -177,6 +177,12 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
177177

178178
@interface JPushCollectControl : NSObject
179179

180+
/* ssid SSID信息。设置为NO,不采集SSID信息。默认为YES。 */
181+
@property (nonatomic, assign) BOOL ssid;
182+
/* bssid BSSID信息。设置为NO,不采集BSSID信息。默认为YES。 */
183+
@property (nonatomic, assign) BOOL bssid;
184+
/* cell 基站信息。设置为NO,不采集基站信息。默认为YES。*/
185+
@property (nonatomic, assign) BOOL cell;
180186
/* gps 经纬度信息。设置为NO,不采集经纬度信息。默认为YES。 */
181187
@property (nonatomic, assign) BOOL gps;
182188

@@ -793,6 +799,13 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
793799
*/
794800
+ (void)setPushEnable:(BOOL)isEnable completion:(nullable void (^)(NSInteger iResCode))completion;
795801

802+
/*!
803+
* @abstract 设置用户分群推送功能开关
804+
*
805+
* @param isEnable YES:开启,NO:关闭,默认是开启。
806+
*
807+
*/
808+
+ (void)setSmartPushEnable:(BOOL)isEnable;
796809

797810
/*!
798811
* @abstract 设置应用内提醒消息的代理

0 commit comments

Comments
 (0)