Skip to content
This repository has been archived by the owner on Oct 9, 2021. It is now read-only.

Commit

Permalink
Release SealTalk Demo version 1.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Feb 16, 2017
1 parent 3a57c67 commit 27c643d
Show file tree
Hide file tree
Showing 46 changed files with 267 additions and 82 deletions.
78 changes: 37 additions & 41 deletions ios-rongimdemo/RCDAboutRongCloudTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,48 +213,28 @@ - (void)tableView:(UITableView *)tableView

-(void)gotoDebugModel
{
NSString *isDisplayID = [[NSUserDefaults standardUserDefaults] objectForKey:@"isDisplayID"];
NSString *isDisplayOnlineStatus = [[NSUserDefaults standardUserDefaults] objectForKey:@"isDisplayOnlineStatus"];
if ([isDisplayID isEqualToString:@"YES"] && [isDisplayOnlineStatus isEqualToString:@"YES"]) {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:nil
message:@"Debug模式"
delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:@"强制Crash",@"关闭显示ID",@"关闭显示在线状态", nil];
alert.delegate = self;
[alert show];

} else if (isDisplayID == nil && [isDisplayOnlineStatus isEqualToString:@"YES"]) {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:nil
message:@"Debug模式"
delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:@"强制Crash",@"显示ID",@"关闭显示在线状态", nil];
alert.delegate = self;
[alert show];
} else if ([isDisplayID isEqualToString:@"YES"] && isDisplayOnlineStatus == nil) {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:nil
message:@"Debug模式"
delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:@"强制Crash",@"关闭显示ID",@"显示在线状态", nil];
alert.delegate = self;
[alert show];
NSString *isDisplayID = @"显示ID";
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"isDisplayID"] isEqualToString:@"YES"]) {
isDisplayID = @"关闭显示ID";
}
NSString *isDisplayOnlineStatus = @"显示在线状态";
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"isDisplayOnlineStatus"] isEqualToString:@"YES"]) {
isDisplayOnlineStatus = @"关闭显示在线状态";
}

else {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:nil
message:@"Debug模式"
delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:@"强制Crash",@"显示ID",@"显示在线状态", nil];
alert.delegate = self;
[alert show];
NSString *stayAfterJoinChatRoomFailed = @"加入聊天室失败仍停留在会话界面";
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"stayAfterJoinChatRoomFailed"] isEqualToString:@"YES"]) {
stayAfterJoinChatRoomFailed = @"加入聊天室失败自动退出会话界面";
}

UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:nil
message:@"Debug模式"
delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:@"强制Crash",isDisplayID,isDisplayOnlineStatus,stayAfterJoinChatRoomFailed, nil];
alert.delegate = self;
[alert show];
}

//force crash for test
Expand All @@ -263,7 +243,7 @@ - (void)forceCrash {
x = x/x;
}

-(void) setIsDisplayId
-(void)setIsDisplayId
{
NSString *isDisplayID = [[NSUserDefaults standardUserDefaults] objectForKey:@"isDisplayID"];
if ([isDisplayID isEqualToString:@"YES"]) {
Expand All @@ -276,7 +256,7 @@ -(void) setIsDisplayId
}
}

-(void) setIsDisplayOnlineStatus
-(void)setIsDisplayOnlineStatus
{
NSString *isDisplayOnlineStatus = [[NSUserDefaults standardUserDefaults] objectForKey:@"isDisplayOnlineStatus"];
if ([isDisplayOnlineStatus isEqualToString:@"YES"]) {
Expand All @@ -289,6 +269,18 @@ -(void) setIsDisplayOnlineStatus
}
}

-(void)setStayAfterJoinChatRoomFailed
{
NSString *stayAfterJoinChatRoomFailed = [[NSUserDefaults standardUserDefaults] objectForKey:@"stayAfterJoinChatRoomFailed"];
if ([stayAfterJoinChatRoomFailed isEqualToString:@"YES"]) {
[DEFAULTS setObject:nil forKey:@"stayAfterJoinChatRoomFailed"];
[DEFAULTS synchronize];
} else {
[DEFAULTS setObject:@"YES" forKey:@"stayAfterJoinChatRoomFailed"];
[DEFAULTS synchronize];
}
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch (buttonIndex) {
Expand All @@ -304,6 +296,10 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
[self setIsDisplayOnlineStatus];
break;

case 4:
[self setStayAfterJoinChatRoomFailed];
break;

default:
break;
}
Expand Down
2 changes: 2 additions & 0 deletions ios-rongimdemo/RCDBaseSettingTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ -(id)initWithLeftImageStr:(NSString *)leftImageStr
if (self) {
if (leftImageStr != nil) {
self.leftImageView = [[UIImageView alloc] init];
self.leftImageView.contentMode = UIViewContentModeScaleAspectFill;
[self setImageView:self.leftImageView ImageStr:leftImageStr imageSize:leftImageSize LeftOrRight:0];
}
if (rightImageStr != nil) {
self.rightImageView = [[UIImageView alloc] init];
self.rightImageView.contentMode = UIViewContentModeScaleAspectFill;
[self setImageView:self.rightImageView ImageStr:rightImageStr imageSize:rightImageSize LeftOrRight:1];
}
}
Expand Down
9 changes: 0 additions & 9 deletions ios-rongimdemo/RCDMeCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ - (void)drawRect:(CGRect)rect {
}
*/

+ (RCDMeCell *)shareInstance {
static RCDMeCell *instance = nil;
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
instance = [[[self class] alloc] init];
});
return instance;
}

- (void)setCellWithImageName:(NSString *)imageName labelName:(NSString *)labelName {
[self setImageView:self.leftImageView ImageStr:imageName imageSize:CGSizeMake(18, 18) LeftOrRight:0];
self.leftLabel.text = labelName;
Expand Down
1 change: 1 addition & 0 deletions ios-rongimdemo/RCDPersonDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ - (void)viewDidLoad {
[self.view addSubview:self.infoView];

self.ivAva = [[UIImageView alloc]init];
self.ivAva.contentMode = UIViewContentModeScaleAspectFill;
self.ivAva.translatesAutoresizingMaskIntoConstraints = NO;
[self.infoView addSubview:self.ivAva];

Expand Down
2 changes: 1 addition & 1 deletion ios-rongimdemo/RCDSettingServerUrlViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ - (void)forgetPswEvent {
- (IBAction)btnDoneClicked:(id)sender {
if (![self checkContent])
return;

RCNetworkStatus status =
[[RCIMClient sharedRCIMClient] getCurrentNetworkStatus];

Expand Down
13 changes: 13 additions & 0 deletions ios-rongimdemo/RCloudMessage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,14 @@
name = SearchView;
sourceTree = "<group>";
};
27579B631E10D28700A30A62 /* PTT */ = {
isa = PBXGroup;
children = (
);
name = PTT;
path = framework/PTT;
sourceTree = SOURCE_ROOT;
};
27C02B7C1D8E4B730082728C /* GroupCreate */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1608,6 +1616,7 @@
E4C4E7E71A0A309100140067 /* Frameworks */ = {
isa = PBXGroup;
children = (
27579B631E10D28700A30A62 /* PTT */,
F894EC361DF7E3A200EFD084 /* BQMM */,
27C42EE91DE30637003E2306 /* ifly */,
27AADC251DDC4DB800E1AE31 /* AddressBook.framework */,
Expand Down Expand Up @@ -2632,6 +2641,7 @@
"$(PROJECT_DIR)/framework/AlipaySDK",
"$(PROJECT_DIR)/framework/ifly",
"$(PROJECT_DIR)/framework/bqmm",
"$(PROJECT_DIR)/framework/PTT",
);
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
Expand Down Expand Up @@ -2777,6 +2787,7 @@
"$(PROJECT_DIR)/framework/AlipaySDK",
"$(PROJECT_DIR)/framework/ifly",
"$(PROJECT_DIR)/framework/bqmm",
"$(PROJECT_DIR)/framework/PTT",
);
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
Expand Down Expand Up @@ -3081,6 +3092,7 @@
"$(PROJECT_DIR)/framework/AlipaySDK",
"$(PROJECT_DIR)/framework/ifly",
"$(PROJECT_DIR)/framework/bqmm",
"$(PROJECT_DIR)/framework/PTT",
);
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
Expand Down Expand Up @@ -3121,6 +3133,7 @@
"$(PROJECT_DIR)/framework/AlipaySDK",
"$(PROJECT_DIR)/framework/ifly",
"$(PROJECT_DIR)/framework/bqmm",
"$(PROJECT_DIR)/framework/PTT",
);
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
Expand Down
2 changes: 1 addition & 1 deletion ios-rongimdemo/RCloudMessage/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ - (void)redirectNSlogToDocumentFolder {
- (void)didReceiveMessageNotification:(NSNotification *)notification {
NSNumber *left = [notification.userInfo objectForKey:@"left"];
if ([RCIMClient sharedRCIMClient].sdkRunningMode ==
RCSDKRunningMode_Backgroud &&
RCSDKRunningMode_Background &&
0 == left.integerValue) {
int unreadMsgCount = [[RCIMClient sharedRCIMClient] getUnreadCount:@[
@(ConversationType_PRIVATE),
Expand Down
6 changes: 3 additions & 3 deletions ios-rongimdemo/RCloudMessage/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.8.5 Dev</string>
<string>2.8.6 Stable</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -42,7 +42,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>201701092341</string>
<string>201702161756</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down Expand Up @@ -121,7 +121,7 @@
<key>NSPhotoLibraryUsageDescription</key>
<string>访问相册</string>
<key>SealTalk Version</key>
<string>1.1.11</string>
<string>1.1.12</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
Expand Down
23 changes: 20 additions & 3 deletions ios-rongimdemo/RCloudMessage/RCDChatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,16 @@ - (void)popupChatViewController {
*/
- (void)rightBarButtonItemClicked:(id)sender {
if (self.conversationType == ConversationType_PRIVATE) {
RCDPrivateSettingsTableViewController *settingsVC = [RCDPrivateSettingsTableViewController privateSettingsTableViewController];
settingsVC.userId = self.targetId;
[self.navigationController pushViewController:settingsVC animated:YES];
RCDUserInfo *friendInfo = [[RCDataBaseManager shareInstance] getFriendInfo:self.targetId];
if (![friendInfo.status isEqualToString:@"20"]) {
RCDAddFriendViewController *vc = [[RCDAddFriendViewController alloc] init];
vc.targetUserInfo = friendInfo;
[self.navigationController pushViewController:vc animated:YES];
} else {
RCDPrivateSettingsTableViewController *settingsVC = [RCDPrivateSettingsTableViewController privateSettingsTableViewController];
settingsVC.userId = self.targetId;
[self.navigationController pushViewController:settingsVC animated:YES];
}
} else if (self.conversationType == ConversationType_DISCUSSION) {
RCDDiscussGroupSettingViewController *settingVC =
[[RCDDiscussGroupSettingViewController alloc] init];
Expand Down Expand Up @@ -1013,5 +1020,15 @@ -(NSArray *)sortForHasReadList: (NSDictionary *)readReceiptUserDic {
return result;
}

- (BOOL)stayAfterJoinChatRoomFailed {
//加入聊天室失败之后,是否还停留在会话界面
return [[[NSUserDefaults standardUserDefaults] objectForKey:@"stayAfterJoinChatRoomFailed"] isEqualToString:@"YES"];
}

- (void)alertErrorAndLeft:(NSString *)errorInfo {
if (![self stayAfterJoinChatRoomFailed]) {
[super alertErrorAndLeft:errorInfo];
}
}

@end
1 change: 0 additions & 1 deletion ios-rongimdemo/RCloudMessage/RCDMeTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ - (void)setUserPortrait:(NSNotification *)notifycation {
- (void)chatWithCustomerService:(NSString *)kefuId {
RCDCustomerServiceViewController *chatService =
[[RCDCustomerServiceViewController alloc] init];

// live800 KEFU146227005669524 live800的客服ID
// zhichi KEFU146001495753714 智齿的客服ID
chatService.conversationType = ConversationType_CUSTOMERSERVICE;
Expand Down
2 changes: 1 addition & 1 deletion ios-rongimdemo/RCloudMessage/RCDRegisterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ - (void)keyboardWillShow:(NSNotification *)notif {
animations:^{

self.view.frame =
CGRectMake(0.f, -50, self.view.frame.size.width,
CGRectMake(0.f, -150, self.view.frame.size.width,
self.view.frame.size.height);
_headBackground.frame =
CGRectMake(0, 70, self.view.bounds.size.width, 50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ - (void)setColorAndLabel:(NSString *)userId Nickname:(NSString *)nickname {

//设置字母Label
UILabel *firstCharacterLabel = [[UILabel alloc] init];

NSString *firstLetter = nil;
if(nickname.length > 0){
firstLetter = [nickname substringToIndex:1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ - (void)drawRect:(CGRect)rect {

// Center HUD
CGRect allRect = self.bounds;
// Draw rounded HUD backgroud rect
// Draw rounded HUD background rect
CGRect boxRect =
CGRectMake(round((allRect.size.width - size.width) / 2) + self.xOffset,
round((allRect.size.height - size.height) / 2) + self.yOffset,
Expand Down
4 changes: 4 additions & 0 deletions ios-rongimdemo/autobuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ else
sed -i '' -e '/redirectNSlogToDocumentFolder/s/\/\///g' ./RCloudMessage/AppDelegate.m
sed -i "" -e '/UIFileSharingEnabled/{n;s/false/true/; }' ./RCloudMessage/Info.plist
sed -i '' -e 's/RCDDebugTestFunction 1/\RCDDebugTestFunction 0/g' ./RCloudMessage/Utilities/RCDCommonDefine.h
# 去除demo中PTT相关依赖
sed -i '' -e '/RongCloudPTT/d' ./RCloudMessage.xcodeproj/project.pbxproj
sed -i '' -e '/RongPTTKit/d' ./RCloudMessage.xcodeproj/project.pbxproj
sed -i '' -e '/RongPTTLib/d' ./RCloudMessage.xcodeproj/project.pbxproj
fi

# 替换友盟 Key
Expand Down
Loading

0 comments on commit 27c643d

Please sign in to comment.