接入七鱼SDK
This commit is contained in:
3
Podfile
3
Podfile
@@ -38,7 +38,7 @@ target 'xplan-ios' do
|
||||
#pop动画
|
||||
pod 'pop', '~> 1.0.12'
|
||||
#云信
|
||||
pod 'NIMSDK_LITE', '~> 9.0.1'
|
||||
pod 'NIMSDK_LITE', '~> 8.9.0'
|
||||
#下拉刷新控件
|
||||
pod 'MJRefresh'
|
||||
#登录的
|
||||
@@ -61,6 +61,7 @@ target 'xplan-ios' do
|
||||
pod 'IQKeyboardManager', '~> 6.5.5'
|
||||
pod 'TZImagePickerController'
|
||||
pod 'Bugly'
|
||||
pod 'QY_iOS_SDK', '~> 8.2.0'
|
||||
#上传音乐
|
||||
pod 'CocoaAsyncSocket',:modular_headers => true
|
||||
#调试
|
||||
|
15
Podfile.lock
15
Podfile.lock
@@ -48,7 +48,7 @@ PODS:
|
||||
- mob_sharesdk/ShareSDK
|
||||
- MOBFoundation (>= 3.2.9)
|
||||
- MOBFoundation (3.2.27)
|
||||
- NIMSDK_LITE (9.0.1)
|
||||
- NIMSDK_LITE (8.9.110)
|
||||
- NTESBaseComponent (1.4)
|
||||
- NTESQuickPass (3.2.6):
|
||||
- NTESBaseComponent
|
||||
@@ -57,6 +57,10 @@ PODS:
|
||||
- QGVAPlayer (1.0.15)
|
||||
- Qiniu (8.3.2):
|
||||
- HappyDNS (~> 0.3.17)
|
||||
- QY_iOS_SDK (8.2.0):
|
||||
- QY_iOS_SDK/Default (= 8.2.0)
|
||||
- QY_iOS_SDK/Default (8.2.0):
|
||||
- NIMSDK_LITE (= 8.9.110)
|
||||
- ReactiveObjC (3.1.1)
|
||||
- SDCycleScrollView (1.82):
|
||||
- SDWebImage (>= 5.0.0)
|
||||
@@ -112,11 +116,12 @@ DEPENDENCIES:
|
||||
- mob_sharesdk/ShareSDKPlatforms/Apple
|
||||
- mob_sharesdk/ShareSDKPlatforms/QQ
|
||||
- mob_sharesdk/ShareSDKPlatforms/WeChat
|
||||
- NIMSDK_LITE (~> 9.0.1)
|
||||
- NIMSDK_LITE (~> 8.9.0)
|
||||
- NTESQuickPass
|
||||
- pop (~> 1.0.12)
|
||||
- QGVAPlayer
|
||||
- Qiniu
|
||||
- QY_iOS_SDK (~> 8.2.0)
|
||||
- ReactiveObjC
|
||||
- SDCycleScrollView
|
||||
- SDWebImage
|
||||
@@ -158,6 +163,7 @@ SPEC REPOS:
|
||||
- Protobuf
|
||||
- QGVAPlayer
|
||||
- Qiniu
|
||||
- QY_iOS_SDK
|
||||
- ReactiveObjC
|
||||
- SDCycleScrollView
|
||||
- SDWebImage
|
||||
@@ -194,13 +200,14 @@ SPEC CHECKSUMS:
|
||||
MJRefresh: ec9c53ff4abf3a9237b4283862f1bd51c2ee3fdb
|
||||
mob_sharesdk: a60006891a079486ff3269ed326adfa05a967c01
|
||||
MOBFoundation: efdc3ce6b843fbc10ae8c1c6122a02b0d845b39b
|
||||
NIMSDK_LITE: c376a3f90c1cd79d9cca39fbdeb6a718e99e244a
|
||||
NIMSDK_LITE: 299ff39677d705b91413d14ad352b32a1b0e72fe
|
||||
NTESBaseComponent: 9e97373eec7e5a26c39db26477bf99a37ee9e71a
|
||||
NTESQuickPass: 781bd12ee63681389fe9b646c837fa76e3a00e6e
|
||||
pop: d582054913807fd11fd50bfe6a539d91c7e1a55a
|
||||
Protobuf: 3724efa50cb2846d7ccebc8691c574e85fd74471
|
||||
QGVAPlayer: 002673a02b4e50f9f53d0673b87168b540a300ae
|
||||
Qiniu: 61f1e2fdfb35b37f98c8f03a718faf12652f9994
|
||||
QY_iOS_SDK: d41d5d780195d7c46745e334376008a9671388e3
|
||||
ReactiveObjC: 011caa393aa0383245f2dcf9bf02e86b80b36040
|
||||
SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf
|
||||
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
|
||||
@@ -217,6 +224,6 @@ SPEC CHECKSUMS:
|
||||
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
|
||||
YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
|
||||
|
||||
PODFILE CHECKSUM: 89b628f1802cd346dba7b8c67843e04ac421b2ed
|
||||
PODFILE CHECKSUM: b9959c2f321e9cc9dc656ce6b1e01f6367878718
|
||||
|
||||
COCOAPODS: 1.11.3
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#import <UMCommon/UMCommon.h>
|
||||
#import <UserNotifications/UNUserNotificationCenter.h>
|
||||
#import <Bugly/Bugly.h>
|
||||
#import <QYSDK/QYSDK.h>
|
||||
#import <IQKeyboardManager.h>
|
||||
///Tool
|
||||
#import "XPConstant.h"
|
||||
#import "CustomAttachmentDecoder.h"
|
||||
@@ -37,6 +39,7 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
[self configUMengSDK];
|
||||
[self initEmojiData];
|
||||
[self configBugly];
|
||||
[self configQIYUSDK];
|
||||
}
|
||||
|
||||
- (void)configShareSDK {
|
||||
@@ -71,9 +74,15 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
}
|
||||
[[UIApplication sharedApplication] registerForRemoteNotifications];
|
||||
}
|
||||
- (void)configQIYUSDK {
|
||||
[[QYSDK sharedSDK] registerAppId:@"b6b7ca22f8ce319dea3a7456dc211fec" appName:@"音萌"];
|
||||
[QYSDK sharedSDK].customUIConfig.sessionBackground.backgroundColor = [UIColor redColor];
|
||||
[QYSDK sharedSDK].customUIConfig.showAudioEntry = NO;
|
||||
[QYSDK sharedSDK].customUIConfig.autoShowKeyboard = NO;
|
||||
[QYSDK sharedSDK].customUIConfig.serviceHeadImage = [UIImage imageNamed:@"ming_setting_about_us"];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**ming_setting_about_us
|
||||
崩溃收集 Bugly
|
||||
*/
|
||||
- (void) configBugly {
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <QYSDK/QYSDK.h>
|
||||
|
||||
@interface BaseMvpPresenter()
|
||||
|
||||
@@ -32,6 +33,11 @@
|
||||
if ([NIMSDK sharedSDK].loginManager.isLogined) {
|
||||
[[NIMSDK sharedSDK].loginManager logout:nil];
|
||||
}
|
||||
|
||||
[[QYSDK sharedSDK] logout:^(BOOL success) {
|
||||
NSLog(@"你好");
|
||||
}];
|
||||
|
||||
// 2. 跳登录页面
|
||||
[[self getView] tokenInvalid];
|
||||
}
|
||||
|
@@ -69,6 +69,7 @@
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
[self.view addSubview:self.backImageView];
|
||||
[self.view addSubview:self.backButton];
|
||||
[self.view addSubview:self.titleLabel];
|
||||
@@ -283,9 +284,9 @@
|
||||
- (UIButton *)retryCodeButton {
|
||||
if (!_retryCodeButton) {
|
||||
_retryCodeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_retryCodeButton setTitle:@"重新获取验证码" forState:UIControlStateNormal];
|
||||
[_retryCodeButton setTitleColor:[ThemeColor appMainColor] forState:UIControlStateNormal];
|
||||
_retryCodeButton.titleLabel.font = [UIFont systemFontOfSize:11];
|
||||
[_retryCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
|
||||
[_retryCodeButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
|
||||
_retryCodeButton.titleLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium];
|
||||
_retryCodeButton.hidden = YES;
|
||||
}
|
||||
return _retryCodeButton;
|
||||
|
@@ -36,6 +36,10 @@
|
||||
break;
|
||||
case NIMMessageTypeCustom: {
|
||||
NIMCustomObject *obj = (NIMCustomObject *) message.messageObject;
|
||||
if (![obj.attachment isKindOfClass:[AttachmentModel class]]) {
|
||||
text = @"";
|
||||
break;
|
||||
}
|
||||
AttachmentModel *attachment = (AttachmentModel *) obj.attachment;
|
||||
if (attachment.first == CustomMessageType_Secretary) {
|
||||
if (attachment.second == Custom_Message_Sub_Secretary_Router) {
|
||||
|
@@ -166,16 +166,19 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
|
||||
__block int unreadCount = 0;
|
||||
NSMutableArray<NSString *> * uids = [[NSMutableArray alloc] init];
|
||||
NSMutableArray *officalArray = [NSMutableArray array];
|
||||
NSMutableArray* sessionList = [NSMutableArray array];
|
||||
[self.recentSessions enumerateObjectsUsingBlock:^(NIMRecentSession * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (self.openType != SessionListOpenTypeRoom && [[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:obj.session.sessionId]) {
|
||||
[officalArray addObject:obj];
|
||||
[self.headView updateBadgeWithSessionId:obj.session.sessionId unreadCount:obj.unreadCount];
|
||||
} else {
|
||||
[uids addObject:obj.session.sessionId];
|
||||
if (obj.session.sessionId.integerValue > 0) {
|
||||
[sessionList addObject:obj];
|
||||
unreadCount += obj.unreadCount;
|
||||
}
|
||||
}
|
||||
}];
|
||||
[self.recentSessions removeObjectsInArray:officalArray];
|
||||
self.recentSessions = sessionList;
|
||||
[self setTabBarItemBadge:unreadCount];
|
||||
[[NIMSDK sharedSDK].userManager fetchUserInfos:uids completion:nil];
|
||||
|
||||
@@ -260,7 +263,9 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
|
||||
[self.headView updateBadgeWithSessionId:recentSession.session.sessionId unreadCount:recentSession.unreadCount];
|
||||
return;
|
||||
}
|
||||
if (recentSession.session.sessionId.integerValue > 0) {
|
||||
[self.recentSessions addObject:recentSession];
|
||||
}
|
||||
[self.recentSessions sortUsingComparator:^NSComparisonResult(id obj1, id obj2) {
|
||||
NIMRecentSession *item1 = obj1;
|
||||
NIMRecentSession *item2 = obj2;
|
||||
@@ -289,7 +294,9 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
|
||||
}
|
||||
}
|
||||
NSInteger insert = [self findInsertPlace:recentSession];
|
||||
if (recentSession.session.sessionId.integerValue > 0) {
|
||||
[self.recentSessions insertObject:recentSession atIndex:insert];
|
||||
}
|
||||
[self.sessionListView reloadData];
|
||||
[self setTabBarItemBadge:totalUnreadCount];
|
||||
}
|
||||
|
@@ -251,9 +251,11 @@
|
||||
|
||||
- (void)didMoveToSuperview {
|
||||
[super didMoveToSuperview];
|
||||
if (self.superview) {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(self.superview);
|
||||
}];
|
||||
}
|
||||
[self layoutIfNeeded];
|
||||
}
|
||||
|
||||
|
@@ -9,6 +9,8 @@
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <flutter_boost/FlutterBoost.h>
|
||||
#import <IQKeyboardManager.h>
|
||||
#import <QYSDK/QYSDK.h>
|
||||
///Tool
|
||||
#import "TTPopup.h"
|
||||
#import "XPMacro.h"
|
||||
@@ -626,7 +628,15 @@
|
||||
}
|
||||
break;
|
||||
case XPMineItemType_Customer_Center: {
|
||||
///TODO: 跳转客服中心
|
||||
[QYSDK sharedSDK].customUIConfig.customerHeadImageUrl = self.userInfo.avatar;
|
||||
QYSource *source = [[QYSource alloc] init];
|
||||
source.title = @"音萌客服";
|
||||
source.urlString = @"https://gzhfwlkjyxgs.qiyukf.com/";
|
||||
[[IQKeyboardManager sharedManager].disabledDistanceHandlingClasses addObject:[QYSessionViewController class]];
|
||||
QYSessionViewController *sessionViewController = [[QYSDK sharedSDK] sessionViewController];
|
||||
sessionViewController.sessionTitle = @"音萌客服";
|
||||
sessionViewController.source = source;
|
||||
[self.navigationController pushViewController:sessionViewController animated:YES];
|
||||
|
||||
}
|
||||
break;
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
#import <AFNetworkReachabilityManager.h>
|
||||
#import <POP.h>
|
||||
#import <QYSDK/QYSDK.h>
|
||||
///Tool
|
||||
#import "XPMacro.h"
|
||||
#import "ThemeColor.h"
|
||||
@@ -373,6 +374,27 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
[self.presenter logout];
|
||||
}
|
||||
|
||||
- (void)onLogin:(NIMLoginStep)step {
|
||||
if(step == NIMLoginStepLoginOK) {
|
||||
NSLog(@"登录陈宫");
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
if ([QYSDK sharedSDK].currentUserID != uid) {
|
||||
[[QYSDK sharedSDK] logout:^(BOOL success) {
|
||||
if (success) {
|
||||
QYUserInfo * userinfo = [[QYUserInfo alloc] init];
|
||||
userinfo.userId = uid;
|
||||
[[QYSDK sharedSDK] setUserInfo:userinfo];
|
||||
}
|
||||
}];
|
||||
|
||||
} else {
|
||||
QYUserInfo * userinfo = [[QYUserInfo alloc] init];
|
||||
userinfo.userId = uid;
|
||||
[[QYSDK sharedSDK] setUserInfo:userinfo];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onKickout:(NIMLoginKickoutResult *)result {
|
||||
[XCHUDTool showErrorWithMessage:@"您已被踢下线,若非正常行为,请及时修改密码"];
|
||||
UIViewController *rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
|
||||
|
Reference in New Issue
Block a user