Skip to content

Commit bcbe8f1

Browse files
author
yanm
committed
[update]:package.json 更新版本号1.1.39
1 parent 8136f30 commit bcbe8f1

File tree

6 files changed

+164
-68
lines changed

6 files changed

+164
-68
lines changed

GetuiConfiguration.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ function insertIOSImplCode(path){
7373
// 这个插入代码 didRegisterForRemoteNotificationsWithDeviceToken
7474
var rf = fs.readFileSync(path,"utf-8");
7575
var search = rf.match(/\n.*didRegisterForRemoteNotificationsWithDeviceToken\:\(NSData \*\)deviceToken[ ]*\{/);
76-
var tokenMatchStr = "\n NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@\"<>\"]];\n token = [token stringByReplacingOccurrencesOfString:@\" \" withString:@\"\"];\n NSLog(\@\"\>\>\>[DeviceToken Success]:\%\@\", token);\n\/\/ [ GTSdk ]:向个推服务器注册deviceToken\n [GeTuiSdk registerDeviceToken:token];\n"
76+
var tokenMatchStr = "\n NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@\"<>\"]];\n token = [token stringByReplacingOccurrencesOfString:@\" \" withString:@\"\"];\n NSLog(\@\"\>\>\>[DeviceToken Success]:\%\@\", token);\n\/\/ [ GTSdk ]:向个推服务器注册deviceToken\n [GeTuiSdk registerDeviceTokenData:deviceToken];\n"
7777
if (search == null) {
7878
console.log("没有匹配到 函数 didRegisterForRemoteNotificationsWithDeviceToken");
7979
rf = rf.replace(/\@end/,"/** 远程通知注册成功委托 */\n \- \(void\)application\:\(UIApplication \*\)application\ didRegisterForRemoteNotificationsWithDeviceToken\:\(NSData \*\)deviceToken \{"+ tokenMatchStr +"\}\n\@end");
8080
// console.log(rf);
8181
fs.writeFileSync(path, rf, "utf-8");
8282
} else {
83-
var oldValue = rf.match(/\[GeTuiSdk registerDeviceToken:token/)
83+
var oldValue = rf.match(/\[GeTuiSdk registerDeviceTokenData:deviceToken/)
8484
if(oldValue == null) {
8585
rf = rf.replace(search[0], search[0] + tokenMatchStr);
8686
fs.writeFileSync(path, rf, "utf-8");

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ npm run GetuiConfigure DI1jwW3FtZ6kGDeY5dk0Y9 DQCk2V8Jev9hqhWDU94PF9 Rtyp5trKUt8
3030
3131
````
3232

33+
```
34+
// 链接iOS原生代码
35+
npx pod-install
36+
```
37+
3338
(如果是原生应用集成react-native)使用CocoaPods安装
3439

3540
如果你的 React Native 是通过 Cocoapods 来集成的则使用下面两个步骤来集成,注意: 使用 pod 就不要使用 react-native link 了,不然会有冲突。

ios/RCTGetuiModule/RCTGetuiModule/GeTuiSdk.h

+24-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
// Created by gexin on 15-5-5.
66
// Copyright (c) 2015年 Gexin Interactive (Beijing) Network Technology Co.,LTD. All rights reserved.
77
//
8-
// GTSDK-Version: 2.4.1.0
8+
// GTSDK-Version: 2.4.6.0-noidfa
99

1010
#import <Foundation/Foundation.h>
1111

12-
typedef enum {
12+
typedef NS_ENUM(NSUInteger, SdkStatus) {
1313
SdkStatusStarting, // 正在启动
1414
SdkStatusStarted, // 启动、在线
1515
SdkStatusStoped, // 停止
1616
SdkStatusOffline, // 离线
17-
} SdkStatus;
17+
};
1818

1919
#define kGtResponseBindType @"bindAlias"
2020
#define kGtResponseUnBindType @"unbindAlias"
@@ -125,14 +125,24 @@ typedef enum {
125125
#pragma mark -
126126

127127
/**
128-
* 给用户打标签 , 后台可以根据标签进行推送
128+
* 给用户打标签, 后台可以根据标签进行推送
129129
*
130130
* @param tags 别名数组
131131
* tag: 只能包含中文字符、英文字母、0-9、+-*_.的组合(不支持空格)
132132
*
133133
* @return 提交结果,YES表示尝试提交成功,NO表示尝试提交失败
134134
*/
135135
+ (BOOL)setTags:(NSArray *)tags;
136+
137+
/**
138+
* 给用户打标签, 后台可以根据标签进行推送
139+
*
140+
* @param tags 别名数组
141+
* tag: 只能包含中文字符、英文字母、0-9、+-*_.的组合(不支持空格)
142+
* @param aSn 绑定序列码, 不为nil
143+
* @return 提交结果,YES表示尝试提交成功,NO表示尝试提交失败
144+
*/
145+
+ (BOOL)setTags:(NSArray *)tags andSequenceNum:(NSString *)aSn;
136146

137147
/**
138148
* 同步角标值到个推服务器
@@ -244,7 +254,7 @@ typedef enum {
244254
/**
245255
* 是否允许SDK 后台运行(默认值:NO)
246256
* 备注:可以未启动SDK就调用该方法
247-
* 警告:该功能会和音乐播放冲突,使用时请注意
257+
* 警告:该功能会和音乐播放冲突,使用时请注意。 需开启Signing & Capabilities > Background Modes > Auido, Airplay and Picture in Picture。
248258
*
249259
* @param isEnable 支持当APP进入后台后,个推是否运行,YES.允许
250260
*/
@@ -328,6 +338,15 @@ typedef enum {
328338
*/
329339
- (void)GeTuiSdkDidAliasAction:(NSString *)action result:(BOOL)isSuccess sequenceNum:(NSString *)aSn error:(NSError *)aError;
330340

341+
/**
342+
* 设置标签回调
343+
*
344+
* @param sequenceNum 请求的序列码
345+
* @param isSuccess 成功返回 YES, 失败返回 NO
346+
* @param aError 成功返回 nil, 错误返回相应error信息
347+
*/
348+
- (void)GeTuiSdkDidSetTagsAction:(NSString *)sequenceNum result:(BOOL)isSuccess error:(NSError *)aError;
349+
331350
/**
332351
* 查询当前绑定tag结果返回
333352
* @param aTags 当前绑定的 tag 信息

0 commit comments

Comments
 (0)