Commit 4fc05d7c by zhangyunjie

1.0.0.14

parent bbe4a95a
......@@ -148,16 +148,16 @@
//压力测试
-(void)loop{
NSString *randomStr = [NSString stringWithFormat:@"ZYJ1%d",arc4random_uniform(1000000)];
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypeText text:randomStr filePath:nil ext:@"123" Finished:^(BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypeText text:randomStr filePath:nil ext:@"123" extIndex:@"1" Finished:^(NSString *extIndex,BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
if (success) {
NSLog(@"发送消息成功,消息:%@",randomStr);
}else{
NSLog(@"发送消息失败,消息:%@,errorMessage:%@",randomStr,errorMessage);
}
} ProgressPercent:^(NSString *key, float percent) {
} ProgressPercent:^(NSString *extIndex, NSString *filePath, float percent) {
NSLog(@"key == %@,percent == %.2f", key,percent);
NSLog(@"extIndex == %@,filePath == %@,percent == %.2f", extIndex,filePath,percent);
}];
}
#pragma mark - 切换环境
......@@ -265,30 +265,30 @@
- (IBAction)sendMeg:(UIButton *)sender {
//发送消息
if (!self.megTextField.text.length) {
[self tipMessageWithTitle:@"请输入消息再发送" message:@""];
return;
}
__weak typeof(self) weakSelf = self;
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypeText text:self.megTextField.text filePath:nil ext:@"123" Finished:^(BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
if (success) {
NSString *msg = @"";
if (sendMsgModel.msg_type == 1) {
msg = [msg stringByAppendingString:sendMsgModel.msg.msg?sendMsgModel.msg.msg:@"nil"];
[self tipMessageWithTitle:@"请输入消息再发送" message:@""];
return;
}
__weak typeof(self) weakSelf = self;
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypeText text:self.megTextField.text filePath:nil ext:@"123" extIndex:@"1" Finished:^(NSString *extIndex,BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
if (success) {
NSString *msg = @"";
if (sendMsgModel.msg_type == 1) {
msg = [msg stringByAppendingString:sendMsgModel.msg.msg?sendMsgModel.msg.msg:@"nil"];
}else{
msg = [msg stringByAppendingString:sendMsgModel.msg.url?sendMsgModel.msg.url:@"nil"];
}
NSString *allmsg = [NSString stringWithFormat:@"%@,拓展内容:%@",msg,sendMsgModel.ext];
[weakSelf tipMessageWithTitle:@"接口发送消息" message:allmsg];
// [weakSelf tipMessageWithTitle:@"发送消息成功" message:@""];
}else{
msg = [msg stringByAppendingString:sendMsgModel.msg.url?sendMsgModel.msg.url:@"nil"];
[weakSelf tipMessageWithTitle:@"发送消息失败" message:errorMessage];
}
NSString *allmsg = [NSString stringWithFormat:@"%@,拓展内容:%@",msg,sendMsgModel.ext];
[weakSelf tipMessageWithTitle:@"接口发送消息" message:allmsg];
// [weakSelf tipMessageWithTitle:@"发送消息成功" message:@""];
}else{
[weakSelf tipMessageWithTitle:@"发送消息失败" message:errorMessage];
}
} ProgressPercent:^(NSString *key, float percent) {
NSLog(@"key == %@,percent == %.2f", key,percent);
}];
} ProgressPercent:^(NSString *extIndex, NSString *filePath, float percent) {
NSLog(@"extIndex == %@,filePath == %@,percent == %.2f", extIndex,filePath,percent);
}];
}
- (IBAction)noReadListAction:(UIButton *)sender {
//获取会话未读消息列表
......@@ -483,35 +483,35 @@
- (IBAction)uploadImage:(UIButton *)sender {
//上传
__weak typeof(self) weakSelf = self;
NSString *filePath = [self getImagePath:self.pickImage];
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypePicture text:nil filePath:filePath ext:@"123" Finished:^(BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
NSString *filePath = [self getImagePath:self.pickImage];
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypePicture text:nil filePath:filePath ext:@"123" extIndex:@"1" Finished:^(NSString *extIndex,BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
if (success) {
[weakSelf tipMessageWithTitle:@"上传成功" message:@""];
}else{
[weakSelf tipMessageWithTitle:@"上传失败" message:errorMessage];
}
} ProgressPercent:^(NSString *extIndex, NSString *filePath, float percent) {
NSLog(@"extIndex == %@,filePath == %@,percent == %.2f", extIndex,filePath,percent);
}];
}
- (IBAction)uploadFile:(UIButton *)sender {
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES).firstObject;
NSString *filePath = [path stringByAppendingPathComponent:@"ZYJ1FMDBIMChat.db"];
__weak typeof(self) weakSelf = self;
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypeFile text:nil filePath:filePath ext:@"123" extIndex:@"1" Finished:^(NSString *extIndex,BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
if (success) {
[weakSelf tipMessageWithTitle:@"上传成功" message:@""];
}else{
[weakSelf tipMessageWithTitle:@"上传失败" message:errorMessage];
}
} ProgressPercent:^(NSString *key, float percent) {
NSLog(@"key == %@,percent == %.2f", key,percent);
} ProgressPercent:^(NSString *extIndex, NSString *filePath, float percent) {
NSLog(@"extIndex == %@,filePath == %@,percent == %.2f", extIndex,filePath,percent);
}];
}
- (IBAction)uploadFile:(UIButton *)sender {
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES).firstObject;
NSString *filePath = [path stringByAppendingPathComponent:@"ZYJ1FMDBIMChat.db"];
__weak typeof(self) weakSelf = self;
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypeFile text:nil filePath:filePath ext:@"123" Finished:^(BOOL success, OffcnIMBodyModel *sendMsgModel, NSString *errorMessage) {
if (success) {
[weakSelf tipMessageWithTitle:@"上传成功" message:@""];
}else{
[weakSelf tipMessageWithTitle:@"上传失败" message:errorMessage];
}
} ProgressPercent:^(NSString *key, float percent) {
NSLog(@"key == %@,percent == %.2f", key,percent);
}];
}
- (IBAction)pressureTest:(UIButton *)sender {
sender.selected = !sender.isSelected;
......
......@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'OffcnIMSDKiOS'
s.version = '1.0.0.13'
s.version = '1.0.0.14'
s.summary = 'OffcnIMSDKiOS.'
s.description = <<-DESC
......
......@@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign)NSInteger msg_type;//消息类型
@property (nonatomic,strong)OffcnIMMsgModel *msg;//消息内容
@property (nonatomic,copy)NSString *extIndex;//开发者扩展字段
@property (nonatomic,copy)NSString *ext;//开发者扩展字段
@property (nonatomic,assign)CGFloat cellH;//扩展字段
......
......@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import "OffcnIMModel.h"
static const NSString *OffcnIMSDKiOSVersion = @"1.0.0.13";
static const NSString *OffcnIMSDKiOSVersion = @"1.0.0.14";
typedef NS_ENUM(NSUInteger, OffcnIMSDKReachabilityStatus) {
OffcnIMSDKReachabilityStatusNotReachable = 0,
......@@ -70,8 +70,9 @@ typedef void(^OffcnIMSDKReachabilityStatusCallBack)(OffcnIMSDKReachabilityStatus
/// @param text 文本
/// @param filePath 图片/音频(语音消息格式,只能是aac格式)/视频/文件,沙盒路径
/// @param ext 开发者扩展字段
/// @param extIndex 开发者扩展字段
/// @param finished 结果回调,最大限制为500字,超过500字报错回调信息:超过500字
-(void)sendMsgWithMsg_fromID:(NSString *)msg_fromID msg_toID:(NSString *)msg_toID msg_type:(OffcnSDKMsgType)msg_type text:(NSString *)text filePath:(NSString *)filePath ext:(NSString *)ext Finished:(void(^)(BOOL success,OffcnIMBodyModel *sendMsgModel,NSString *errorMessage))finished ProgressPercent:(void(^)(NSString *key, float percent))progressPercent;
-(void)sendMsgWithMsg_fromID:(NSString *)msg_fromID msg_toID:(NSString *)msg_toID msg_type:(OffcnSDKMsgType)msg_type text:(NSString *)text filePath:(NSString *)filePath ext:(NSString *)ext extIndex:(NSString *)extIndex Finished:(void(^)(NSString *extIndex,BOOL success,OffcnIMBodyModel *sendMsgModel,NSString *errorMessage))finished ProgressPercent:(void(^)(NSString *extIndex, NSString *filePath, float percent))progressPercent;
/// 用户信息标记已读
/// @param msg_fromID 发送人ID
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment