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.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Jan 10, 2019
1 parent 01b8f5d commit c272e3b
Show file tree
Hide file tree
Showing 621 changed files with 11,620 additions and 227 deletions.
313 changes: 309 additions & 4 deletions ios-rongimdemo/RCloudMessage.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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.9.8 Dev</string>
<string>2.9.9 Dev</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -42,7 +42,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>201811221848</string>
<string>201901091923</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand All @@ -63,7 +63,7 @@
<key>NSPhotoLibraryAddUsageDescription</key>
<string>访问相册</string>
<key>SealTalk Version</key>
<string>1.3.8</string>
<string>1.3.9</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
Expand Down
1 change: 0 additions & 1 deletion ios-rongimdemo/RCloudMessage/RCDChatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,6 @@ - (void)forwardMessage{
- (void)onEndForwardMessage:(NSNotification *)notification{
//置为 NO,将消息 cell 重置为初始状态
self.allowsMessageCellSelection = NO;
[self.conversationMessageCollectionView reloadItemsAtIndexPaths:[self.conversationMessageCollectionView indexPathsForVisibleItems]];
}

- (void)deleteMessages{
Expand Down
73 changes: 30 additions & 43 deletions ios-rongimdemo/RCloudMessage/RCDCustomerServiceViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,8 @@ @implementation RCDCustomerServiceViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self notifyUpdateUnreadMessageCount];

self.evaStarDic = [NSMutableDictionary dictionary];
/*
UIButton *button =
[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)];
UIImageView *imageView =
[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Private_Setting"]];
imageView.frame = CGRectMake(15, 5,16 , 17);
[button addSubview:imageView];
[button addTarget:self
action:@selector(rightBarButtonItemClicked:)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *rightBarButton =
[[UIBarButtonItem alloc] initWithCustomView:button];
*/
self.navigationItem.rightBarButtonItem = nil;

[[RCIMClient sharedRCIMClient] getHumanEvaluateCustomerServiceConfig:^(NSDictionary *evaConfig) {
NSArray *array = [evaConfig valueForKey:@"evaConfig"];
Expand All @@ -60,25 +45,11 @@ - (void)viewDidLoad {
}];
}

/*
- (void)rightBarButtonItemClicked:(id)sender {
RCDSettingBaseViewController *settingVC =
[[RCDSettingBaseViewController alloc] init];
settingVC.conversationType = self.conversationType;
settingVC.targetId = self.targetId;
//清除聊天记录之后reload data
__weak typeof(self) weakSelf = self;
settingVC.clearHistoryCompletion = ^(BOOL isSuccess) {
if (isSuccess) {
[weakSelf.conversationDataRepository removeAllObjects];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.conversationMessageCollectionView reloadData];
});
}
};
[self.navigationController pushViewController:settingVC animated:YES];
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self createNavLeftBarButtonItem];
self.navigationItem.rightBarButtonItems = nil;
}
*/

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
Expand All @@ -89,11 +60,8 @@ - (void)didReceiveMemoryWarning {
//这个函数是基类的函数,他会根据当前服务时间来决定是否弹出评价,根据服务的类型来决定弹出评价类型。
//弹出评价的函数是commentCustomerServiceAndQuit,应用可以根据这个函数内的注释来自定义评价界面。
//等待用户评价结束后调用如下函数离开当前VC。
- (void)leftBarButtonItemPressed:(id)sender {
//需要调用super的实现
[super leftBarButtonItemPressed:sender];

[self.navigationController popToRootViewControllerAnimated:YES];
- (void)clickLeftBarButtonItem:(id)sender {
[super customerServiceLeftCurrentViewController];
}

//评价客服,并离开当前会话
Expand All @@ -112,7 +80,7 @@ - (void)leftBarButtonItemPressed:(id)sender {
//(void)commentCustomerServiceWithStatus:(RCCustomerServiceStatus)serviceStatus
//commentId:(NSString *)commentId quitAfterComment:(BOOL)isQuit {
// if (isQuit) {
// [self leftBarButtonItemPressed:nil];
// [super customerServiceLeftCurrentViewController];;
// }
//}
//*********应用去掉评价界面结束*************
Expand All @@ -129,7 +97,7 @@ - (void)leftBarButtonItemPressed:(id)sender {
self.commentId = commentId;
self.quitAfterComment = isQuit;
if (serviceStatus == 0) {
[self leftBarButtonItemPressed:nil];
[super customerServiceLeftCurrentViewController];;
} else if (serviceStatus == 1) {
//人工评价结果
[self.evaluateView show];
Expand Down Expand Up @@ -159,7 +127,7 @@ - (void)alertView:(UIAlertView *)alertView
}
//(2)离开当前客服VC
if (self.quitAfterComment) {
[self leftBarButtonItemPressed:nil];
[super customerServiceLeftCurrentViewController];;
}
}

Expand Down Expand Up @@ -187,14 +155,14 @@ - (void)didTapViewAction{
- (void)didSubmitEvaluate:(RCCSResolveStatus)solveStatus star:(int)star tagString:(NSString *)tagString suggest:(NSString *)suggest{
[[RCIMClient sharedRCIMClient] evaluateCustomerService:self.targetId dialogId:nil starValue:star suggest:suggest resolveStatus:solveStatus tagText:tagString extra:nil];
if (self.quitAfterComment) {
[self leftBarButtonItemPressed:nil];
[super customerServiceLeftCurrentViewController];;
}
}

- (void)dismissEvaluateView{
[self.evaluateView hide];
if (self.quitAfterComment) {
[self leftBarButtonItemPressed:nil];
[super customerServiceLeftCurrentViewController];;
}
}

Expand All @@ -218,4 +186,23 @@ - (RCDCSAnnounceView *)announceView{
}
return _announceView;
}

#pragma mark Navigation Setting
- (void) createNavLeftBarButtonItem {
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 6, 72, 23);
UILabel *backText = [[UILabel alloc] initWithFrame:CGRectMake(12, 0, 70, 22)];
backText.text = @"返回";
backText.font = [UIFont systemFontOfSize:17];
[backText setBackgroundColor:[UIColor clearColor]];
[backText setTextColor:[RCIM sharedRCIM].globalNavigationBarTintColor];
[backBtn addSubview:backText];
UIImageView *backImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"back"]];
backImg.frame = CGRectMake(-8, 0, 15, 22);
[backBtn addSubview:backImg];
[backBtn addTarget:self action:@selector(clickLeftBarButtonItem:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
[self.navigationItem setLeftBarButtonItem:leftButton];
}

@end
13 changes: 2 additions & 11 deletions ios-rongimdemo/RCloudMessage/RCDTestMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,9 @@ - (NSData *)encode {
}

if (self.senderUserInfo) {
NSMutableDictionary *userInfoDic = [[NSMutableDictionary alloc] init];
if (self.senderUserInfo.name) {
[userInfoDic setObject:self.senderUserInfo.name forKeyedSubscript:@"name"];
}
if (self.senderUserInfo.portraitUri) {
[userInfoDic setObject:self.senderUserInfo.portraitUri forKeyedSubscript:@"portrait"];
}
if (self.senderUserInfo.userId) {
[userInfoDic setObject:self.senderUserInfo.userId forKeyedSubscript:@"id"];
}
[dataDict setObject:userInfoDic forKey:@"user"];
[dataDict setObject:[self encodeUserInfo:self.senderUserInfo] forKey:@"user"];
}

NSData *data = [NSJSONSerialization dataWithJSONObject:dataDict options:kNilOptions error:nil];
return data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "zip.h"
#include "minishared.h"

#include <sys/stat.h>

NSString *const SSZipArchiveErrorDomain = @"SSZipArchiveErrorDomain";

#define CHUNK 16384
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and fitness for purpose.
---------------------------------------------------------------------------
Issue Date: 09/09/2014
*/
#include "aes_ni.h"

#if defined( USE_INTEL_AES_IF_PRESENT )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ Issue Date: 20/12/2007

#endif

#include "aestab.h"

#if defined(__cplusplus)
extern "C"
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>

#ifdef _WIN32
# include <windows.h>
# include <wincrypt.h>
#else
# include <sys/stat.h>
# include <fcntl.h>
# include <unistd.h>
#endif

#include "zlib.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
#include <string.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>

#include "zlib.h"
#include "ioapi.h"

#ifdef _WIN32
# include <direct.h>
# include <io.h>
#else
# include <unistd.h>

# include <utime.h>
# include <sys/types.h>
# include <sys/stat.h>
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <assert.h>

#include "zlib.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <assert.h>

#include "zlib.h"
Expand Down
31 changes: 31 additions & 0 deletions ios-rongimdemo/ServiceExtension/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>ServiceExtension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
<string>NotificationService</string>
</dict>
</dict>
</plist>
13 changes: 13 additions & 0 deletions ios-rongimdemo/ServiceExtension/NotificationService.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// NotificationService.h
// ServiceExtension
//
// Created by rongcloud on 2018/11/26.
// Copyright © 2018 RongCloud. All rights reserved.
//

#import <UserNotifications/UserNotifications.h>

@interface NotificationService : UNNotificationServiceExtension

@end
73 changes: 73 additions & 0 deletions ios-rongimdemo/ServiceExtension/NotificationService.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// NotificationService.m
// ServiceExtension
//
// Created by rongcloud on 2018/11/26.
// Copyright © 2018 RongCloud. All rights reserved.
//

#import "NotificationService.h"
#import <RongIMKit/RongIMKit.h>

@interface NotificationService ()

@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;

@end

@implementation NotificationService

- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {

UNNotificationContent *content1 = request.content;
NSDictionary *userInfo = content1.userInfo;
NSDictionary *aps = [userInfo objectForKey:@"aps"];
NSString *category = [aps objectForKey:@"category"];
if (aps && category && [category isEqualToString:@"RC:RcCmd"]) {
NSString *appData = [userInfo objectForKey:@"appData"];
NSDictionary *appDataDic = [NSJSONSerialization JSONObjectWithData:[appData dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil];
NSString *idString = [appDataDic objectForKey:@"rc-dlt-identifier"];
if (idString) {
[[UNUserNotificationCenter currentNotificationCenter] getDeliveredNotificationsWithCompletionHandler:^(NSArray<UNNotification *> * _Nonnull notifications) {
if (notifications.count == 0) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
self.contentHandler(self.bestAttemptContent);
});
return;
}

for (UNNotification *notice in notifications) {
UNNotificationRequest *request = notice.request;
UNNotificationContent *content = request.content;
NSDictionary *userInfo1 = content.userInfo;
NSString *identifier = userInfo1[@"rc"][@"id"];
if ([idString isEqualToString:identifier]) {
[[UNUserNotificationCenter currentNotificationCenter] removeDeliveredNotificationsWithIdentifiers:@[request.identifier]];
}
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
self.contentHandler(self.bestAttemptContent);

});

}];
}
} else {
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
self.contentHandler(self.bestAttemptContent);
}
}

- (void)serviceExtensionTimeWillExpire {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
self.contentHandler(self.bestAttemptContent);
}

@end
Loading

0 comments on commit c272e3b

Please sign in to comment.