Skip to content

Commit

Permalink
4.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
xushichen committed Jul 24, 2019
1 parent 892bf28 commit 7706e19
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 47 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,14 @@ chatViewManager.orientationMask = UIInterfaceOrientationMaskPortrait;
#### 更新记录:
sdk v4.1.7版本更新功能:
1.适配iOS13
2.修复了已知问题
------
sdk v4.1.6版本更新功能:
1.修复了图片选择器错乱问题
Expand Down
4 changes: 2 additions & 2 deletions UdeskSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'UdeskSDK'
s.version = '4.1.6'
s.version = '4.1.7'
s.license = 'MIT'
s.summary = 'Udesk SDK for iOS'
s.homepage = 'https://github.com/udesk/UdeskSDK-iOS'
Expand All @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.requires_arc = true

s.subspec 'SDK' do |ss|
ss.frameworks = 'AVFoundation', 'CoreTelephony', 'SystemConfiguration', 'MobileCoreServices', 'WebKit', 'MapKit','AssetsLibrary','ImageIO','Accelerate','MediaPlayer','Photos','CoreText'
ss.frameworks = 'AVFoundation', 'CoreTelephony', 'SystemConfiguration', 'MobileCoreServices', 'WebKit', 'MapKit','AssetsLibrary','ImageIO','Accelerate','MediaPlayer','Photos','CoreText', 'AVKit'
ss.source_files = 'UdeskSDK/SDK/*.{h}'
ss.vendored_libraries = 'UdeskSDK/SDK/libUdesk.a'
ss.libraries = 'z', 'xml2', 'resolv', 'sqlite3'
Expand Down
Binary file modified UdeskSDK/SDK/libUdesk.a
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ - (void)didSelectSendTicket {
}

UdeskTicketViewController *offLineTicket = [[UdeskTicketViewController alloc] initWithSDKConfig:self.sdkConfig setting:self.sdkSetting];
offLineTicket.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:offLineTicket animated:YES completion:nil];
}

Expand Down Expand Up @@ -537,6 +538,7 @@ - (void)didTapLocationMessage:(UdeskMessage *)message {
}

UdeskLocationViewController *location = [[UdeskLocationViewController alloc] initWithSDKConfig:self.sdkConfig hasSend:YES];
location.modalPresentationStyle = UIModalPresentationFullScreen;
location.locationModel = model;
[self presentViewController:location animated:YES completion:nil];
}
Expand Down Expand Up @@ -1212,6 +1214,7 @@ - (void)startUdeskLocation {
}

UdeskLocationViewController *location = [[UdeskLocationViewController alloc] initWithSDKConfig:self.sdkConfig hasSend:NO];
location.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:location animated:YES completion:nil];
@udWeakify(self);
location.sendLocationBlock = ^(UdeskLocationModel *model) {
Expand Down Expand Up @@ -1252,6 +1255,7 @@ - (void)openCustomerAlubm {
if (ud_isIOS8 && sdkConfig.isImagePickerEnabled) {

UdeskImagePickerController *imagePicker = [[UdeskImagePickerController alloc] init];
imagePicker.modalPresentationStyle = UIModalPresentationFullScreen;
imagePicker.maxImagesCount = sdkConfig.maxImagesCount;
imagePicker.allowPickingVideo = sdkConfig.allowPickingVideo;
imagePicker.quality = sdkConfig.quality;
Expand Down Expand Up @@ -1307,6 +1311,7 @@ - (void)openCustomerCamera {
smallVideoVC.delegate = self;

UdeskSmallVideoNavigationController *nav = [[UdeskSmallVideoNavigationController alloc] initWithRootViewController:smallVideoVC];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:nav animated:YES completion:nil];
}];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ - (void)layoutTextMessage {

CGSize textSize = CGSizeMake(100, 50);
CGFloat spacing = ud_isIOS11 ? 0 : kUDTextMendSpacing;
if (ud_isIOS13) {
spacing = kUDTextMendSpacing;
}

if (self.message.messageType == UDMessageContentTypeText ||
self.message.messageType == UDMessageContentTypeLeaveMsg) {
Expand Down Expand Up @@ -116,7 +119,8 @@ - (void)setupRichText {
CGFloat bubbleY = [UdeskSDKUtil isBlankString:self.message.nickName] ? CGRectGetMinY(self.avatarFrame) : CGRectGetMaxY(self.nicknameFrame)+kUDCellBubbleToIndicatorSpacing;
self.bubbleFrame = CGRectMake(self.avatarFrame.origin.x+kUDAvatarDiameter+kUDAvatarToBubbleSpacing, bubbleY, richTextSize.width+(kUDBubbleToTextHorizontalSpacing*3), richTextSize.height+(kUDBubbleToTextVerticalSpacing*2));
//接收文字frame
self.textFrame = CGRectMake(kUDBubbleToTextHorizontalSpacing+kUDArrowMarginWidth, kUDBubbleToTextVerticalSpacing, richTextSize.width, richTextSize.height);
CGFloat spacing = ud_isIOS13 ? kUDTextMendSpacing : 0;
self.textFrame = CGRectMake(kUDBubbleToTextHorizontalSpacing+kUDArrowMarginWidth, kUDBubbleToTextVerticalSpacing+spacing, richTextSize.width, richTextSize.height);

//cell高度
self.cellHeight = self.bubbleFrame.size.height+self.bubbleFrame.origin.y+kUDCellBottomMargin;
Expand Down
6 changes: 4 additions & 2 deletions UdeskSDK/UDChatMessage/UDIM/ViewModel/UdeskChatViewModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ - (void)agentOnline {

//咨询对象
if (sdkConfig.productDictionary) {
UdeskMessage *productMessage = [[UdeskMessage alloc] initWithProduct:sdkConfig.productDictionary];
[UdeskManager sendMessage:productMessage progress:nil completion:nil];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UdeskMessage *productMessage = [[UdeskMessage alloc] initWithProduct:sdkConfig.productDictionary];
[UdeskManager sendMessage:productMessage progress:nil completion:nil];
});
}

//移除排队事件
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ - (UdeskLocationModel *)getLocationModel:(CLLocationCoordinate2D)coordinate imag
self.locationName = @"";
}
model.name = self.locationName;
if ([UdeskSDKUtil isBlankString:self.thoroughfare]) {
self.thoroughfare = @"";
}
model.thoroughfare = self.thoroughfare;
model.image = image;
model.longitude = coordinate.longitude;
Expand Down
4 changes: 4 additions & 0 deletions UdeskSDK/UDChatMessage/UDIM/Views/Cells/UdeskLocationCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ - (void)updateCellWithMessage:(UdeskBaseMessage *)baseMessage {
_thoroughfareLabel.text = [NSString stringWithFormat:@"%@",array[4]];
_thoroughfareLabel.frame = locationMessage.locationThoroughfareFrame;
}
else {
_thoroughfareLabel.text = @"";
_thoroughfareLabel.frame = CGRectZero;
}

name = array[3];
}
Expand Down
57 changes: 16 additions & 41 deletions UdeskSDK/UDChatMessage/UDIM/Views/Cells/UdeskVideoCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import "UdeskVideoCell.h"
#import "UdeskVideoMessage.h"
#import <MediaPlayer/MediaPlayer.h>
#import "UdeskSDKUtil.h"
#import "UdeskBundleUtils.h"
#import "UdeskCacheUtil.h"
Expand All @@ -19,6 +18,7 @@
#import "UIImage+UdeskSDK.h"
#import "UIView+UdeskSDK.h"
#import "UdeskSDKAlert.h"
#import <AVKit/AVKit.h>

@interface UdeskVideoCell ()

Expand Down Expand Up @@ -208,55 +208,30 @@ - (void)openVideoWithMessageId:(NSString *)messageId contentURL:(NSString *)cont
url = [NSURL fileURLWithPath:path];
}
else {
url = [NSURL URLWithString:contentURL];
url = [NSURL URLWithString:[contentURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}

MPMoviePlayerViewController *playerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
playerViewController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[playerViewController.moviePlayer prepareToPlay];

if (self.udViewController) {
[self.udViewController presentMoviePlayerViewControllerAnimated:playerViewController];
AVPlayerViewController *playerVC = [[AVPlayerViewController alloc] init];
playerVC.player = [AVPlayer playerWithURL:url];
playerVC.showsPlaybackControls = YES;
playerVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
if (@available(iOS 11.0, *)) {
playerVC.entersFullScreenWhenPlaybackBegins = YES;
}

[[NSNotificationCenter defaultCenter] removeObserver:playerViewController name:MPMoviePlayerPlaybackDidFinishNotification object:playerViewController.moviePlayer];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
}

- (void)moviePlayerPlaybackDidFinish:(NSNotification *)notif {

NSDictionary *userInfo = notif.userInfo;

if ([[userInfo allKeys] containsObject:@"error"]) {

dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC));

dispatch_after(delayTime, dispatch_get_main_queue(), ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[[UIAlertView alloc] initWithTitle:nil
message:getUDLocalizedString(@"udesk_failed_video")
delegate:nil
cancelButtonTitle:getUDLocalizedString(@"udesk_close")
otherButtonTitles:nil] show];
#pragma clang diagnostic pop
});
//开启这个播放的时候支持(全屏)横竖屏哦
if (@available(iOS 11.0, *)) {
playerVC.exitsFullScreenWhenPlaybackEnds = YES;
}

int value = [[notif.userInfo valueForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] intValue];
if (value == MPMovieFinishReasonUserExited) {
if (self.udViewController) {
[self.udViewController dismissMoviePlayerViewControllerAnimated];
[[UdeskSDKUtil currentViewController] presentViewController:playerVC animated:YES completion:^{
if (playerVC.readyForDisplay) {
[playerVC.player play];
}
}
}];
}

- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];

[[Udesk_WHC_HttpManager shared] cancelAllDownloadTaskAndDelFile:YES];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ - (void)customEmoji {
if (![panelModel isKindOfClass:[UdeskEmojiPanelModel class]]) return;
if (!panelModel.stickerPaths || panelModel.stickerPaths == (id)kCFNull) return ;
if (![panelModel.stickerPaths.firstObject isKindOfClass:[NSString class]]) return ;

NSMutableArray *emojiContent = [NSMutableArray new];
for (NSString *path in panelModel.stickerPaths) {
UdeskEmojiContentModel *model = [UdeskEmojiContentModel new];
Expand Down
4 changes: 4 additions & 0 deletions UdeskSDK/UDChatMessage/UDTools/Macro/UdeskSDKMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ _Pragma("clang diagnostic pop")
// 当前版本
#define FUDSystemVersion ([[[UIDevice currentDevice] systemVersion] floatValue])

// 是否IOS13
#define ud_isIOS13 ([[[UIDevice currentDevice]systemVersion]floatValue] >= 13.0)
// 是否IOS12
#define ud_isIOS12 ([[[UIDevice currentDevice]systemVersion]floatValue] >= 12.0)
// 是否IOS11
#define ud_isIOS11 ([[[UIDevice currentDevice]systemVersion]floatValue] >= 11.0)
// 是否IOS10
Expand Down

0 comments on commit 7706e19

Please sign in to comment.