Skip to content

Commit

Permalink
Merge pull request #961 from huangshuni/master
Browse files Browse the repository at this point in the history
ios SDK更新到5.4.0版本
  • Loading branch information
huangshuni authored Sep 30, 2024
2 parents 36a8f77 + 7f6318f commit cd028ed
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 6 deletions.
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ PODS:
- hermes-engine (0.74.1):
- hermes-engine/Pre-built (= 0.74.1)
- hermes-engine/Pre-built (0.74.1)
- JCore (2.1.3):
- JCore (2.2.1):
- React
- JPush (3.0.6):
- JPush (3.1.0):
- React
- RCT-Folly (2024.01.01.00):
- boost
Expand Down Expand Up @@ -1357,8 +1357,8 @@ SPEC CHECKSUMS:
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
hermes-engine: 16b8530de1b383cdada1476cf52d1b52f0692cbc
JCore: c6fd1de888e399343d1a04b836e541dbc5023dcc
JPush: 84890a94022a328f79291ee20891042c53c1ec3f
JCore: 27d0cde74c2136d95ff6e5462dd3cce3838acf52
JPush: 30e91a659b857338102cd88f21cc1dd6cb023fde
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
RCTDeprecation: efb313d8126259e9294dc4ee0002f44a6f676aba
RCTRequired: f49ea29cece52aee20db633ae7edc4b271435562
Expand Down
23 changes: 23 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,4 +493,27 @@ export default class JPush {
*/
appBadge: number;
}): void;

/**
* 设置用户分群推送功能开关
*
*
* @param {boolean} enable, YES:开启,NO:关闭,默认是开启。
*
*/
static setSmartPushEnable(enable: boolean): void;

/**
* 数据采集控制, YES:开启,NO:关闭, 默认开启
*
*/
static setCollectControl(params: {
cell: boolean;
bssid: boolean;
imei: boolean;
imsi: boolean;
mac: boolean;
wifi: boolean;
}): void;

}
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ export default class JPush {
}
static setSmartPushEnable(enable) {
if (Platform.OS == "ios") {
JPushModule.setSmartPushEnable(enable)
}else if (Platform.OS == "android") {
JPushModule.setSmartPushEnable(enable)
}
Expand All @@ -738,6 +739,7 @@ export default class JPush {

static setCollectControl(params) {
if (Platform.OS == "ios") {
JPushModule.setCollectControl(params)
}else if (Platform.OS == "android") {
JPushModule.setCollectControl(params)
}
Expand Down
33 changes: 33 additions & 0 deletions ios/RCTJPushModule/RCTJPushModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,39 @@ - (id)init
[JPUSHService pageLeave:pageName];
}

// 合规
RCT_EXPORT_METHOD(setCollectControl:(NSDictionary *)params)
{
JPushCollectControl *control = [[JPushCollectControl alloc] init];
BOOL gps = YES;
BOOL cell = YES;
BOOL bssid = YES;
BOOL ssid = YES;
if (params[@"gps"] && [params[@"gps"] isKindOfClass:[NSNumber class]]) {
gps = [params[@"gps"] boolValue];
}
if (params[@"cell"] && [params[@"cell"] isKindOfClass:[NSNumber class]]) {
cell = [params[@"cell"] boolValue];
}
if (params[@"bssid"] && [params[@"bssid"] isKindOfClass:[NSNumber class]]) {
bssid = [params[@"bssid"] boolValue];
}
if (params[@"ssid"] && [params[@"ssid"] isKindOfClass:[NSNumber class]]) {
ssid = [params[@"ssid"] boolValue];
}
control.gps = gps;
control.cell = cell;
control.bssid = bssid;
control.ssid = ssid;
[JPUSHService setCollectControl:control];
}

RCT_EXPORT_METHOD(setSmartPushEnable:(BOOL *)enable)
{
[JPUSHService setSmartPushEnable:enable];
}


//应用内消息 代理
- (void)jPushInAppMessageDidShow:(JPushInAppMessage *)inAppMessage {
NSDictionary *responseData = [self convertInappMsg:inAppMessage isShow:YES];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
*/

#define JPUSH_VERSION_NUMBER 5.3.0
#define JPUSH_VERSION_NUMBER 5.4.0

#import <Foundation/Foundation.h>

Expand Down Expand Up @@ -177,6 +177,12 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {

@interface JPushCollectControl : NSObject

/* ssid SSID信息。设置为NO,不采集SSID信息。默认为YES。 */
@property (nonatomic, assign) BOOL ssid;
/* bssid BSSID信息。设置为NO,不采集BSSID信息。默认为YES。 */
@property (nonatomic, assign) BOOL bssid;
/* cell 基站信息。设置为NO,不采集基站信息。默认为YES。*/
@property (nonatomic, assign) BOOL cell;
/* gps 经纬度信息。设置为NO,不采集经纬度信息。默认为YES。 */
@property (nonatomic, assign) BOOL gps;

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

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

/*!
* @abstract 设置应用内提醒消息的代理
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
*/

#define JPUSH_VERSION_NUMBER 5.3.0
#define JPUSH_VERSION_NUMBER 5.4.0

#import <Foundation/Foundation.h>

Expand Down Expand Up @@ -177,6 +177,12 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {

@interface JPushCollectControl : NSObject

/* ssid SSID信息。设置为NO,不采集SSID信息。默认为YES。 */
@property (nonatomic, assign) BOOL ssid;
/* bssid BSSID信息。设置为NO,不采集BSSID信息。默认为YES。 */
@property (nonatomic, assign) BOOL bssid;
/* cell 基站信息。设置为NO,不采集基站信息。默认为YES。*/
@property (nonatomic, assign) BOOL cell;
/* gps 经纬度信息。设置为NO,不采集经纬度信息。默认为YES。 */
@property (nonatomic, assign) BOOL gps;

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

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

/*!
* @abstract 设置应用内提醒消息的代理
Expand Down
Binary file not shown.

0 comments on commit cd028ed

Please sign in to comment.