云信的登录逻辑 被踢
This commit is contained in:
3
Podfile
3
Podfile
@@ -33,11 +33,12 @@ target 'xplan-ios' do
|
|||||||
pod 'BaiduMobStatCodeless', '~> 5.3.5'
|
pod 'BaiduMobStatCodeless', '~> 5.3.5'
|
||||||
#文字自动滚动
|
#文字自动滚动
|
||||||
pod 'MarqueeLabel-ObjC'
|
pod 'MarqueeLabel-ObjC'
|
||||||
|
|
||||||
#声网
|
#声网
|
||||||
pod 'AgoraRtcEngine_iOS', '~> 3.0.1'
|
pod 'AgoraRtcEngine_iOS', '~> 3.0.1'
|
||||||
#pop动画
|
#pop动画
|
||||||
pod 'pop', '~> 1.0.12'
|
pod 'pop', '~> 1.0.12'
|
||||||
|
#云信
|
||||||
|
pod 'NIMSDK_LITE', '~> 7.8.3'
|
||||||
#登录的
|
#登录的
|
||||||
pod 'mob_sharesdk'
|
pod 'mob_sharesdk'
|
||||||
pod 'mob_sharesdk/ShareSDKPlatforms/QQ'
|
pod 'mob_sharesdk/ShareSDKPlatforms/QQ'
|
||||||
|
@@ -40,6 +40,7 @@ PODS:
|
|||||||
- mob_sharesdk/ShareSDK
|
- mob_sharesdk/ShareSDK
|
||||||
- MOBFoundation (>= 3.2.9)
|
- MOBFoundation (>= 3.2.9)
|
||||||
- MOBFoundation (3.2.27)
|
- MOBFoundation (3.2.27)
|
||||||
|
- NIMSDK_LITE (7.8.5)
|
||||||
- NTESQuickPass (2.1.9)
|
- NTESQuickPass (2.1.9)
|
||||||
- pop (1.0.12)
|
- pop (1.0.12)
|
||||||
- Qiniu (8.3.2):
|
- Qiniu (8.3.2):
|
||||||
@@ -70,6 +71,7 @@ DEPENDENCIES:
|
|||||||
- mob_sharesdk/ShareSDKPlatforms/Apple
|
- mob_sharesdk/ShareSDKPlatforms/Apple
|
||||||
- mob_sharesdk/ShareSDKPlatforms/QQ
|
- mob_sharesdk/ShareSDKPlatforms/QQ
|
||||||
- mob_sharesdk/ShareSDKPlatforms/WeChat
|
- mob_sharesdk/ShareSDKPlatforms/WeChat
|
||||||
|
- NIMSDK_LITE (~> 7.8.3)
|
||||||
- NTESQuickPass (~> 2.1.6)
|
- NTESQuickPass (~> 2.1.6)
|
||||||
- pop (~> 1.0.12)
|
- pop (~> 1.0.12)
|
||||||
- Qiniu
|
- Qiniu
|
||||||
@@ -96,6 +98,7 @@ SPEC REPOS:
|
|||||||
- MJExtension
|
- MJExtension
|
||||||
- mob_sharesdk
|
- mob_sharesdk
|
||||||
- MOBFoundation
|
- MOBFoundation
|
||||||
|
- NIMSDK_LITE
|
||||||
- NTESQuickPass
|
- NTESQuickPass
|
||||||
- pop
|
- pop
|
||||||
- Qiniu
|
- Qiniu
|
||||||
@@ -121,6 +124,7 @@ SPEC CHECKSUMS:
|
|||||||
MJExtension: 01704cca2b60a214c10761b6491eab74069d68a9
|
MJExtension: 01704cca2b60a214c10761b6491eab74069d68a9
|
||||||
mob_sharesdk: a60006891a079486ff3269ed326adfa05a967c01
|
mob_sharesdk: a60006891a079486ff3269ed326adfa05a967c01
|
||||||
MOBFoundation: efdc3ce6b843fbc10ae8c1c6122a02b0d845b39b
|
MOBFoundation: efdc3ce6b843fbc10ae8c1c6122a02b0d845b39b
|
||||||
|
NIMSDK_LITE: 8e28ae0a26dd1dccc4684b697381f0a72a733f51
|
||||||
NTESQuickPass: 8431dc52737c95883cd382c2ee75664d58f39377
|
NTESQuickPass: 8431dc52737c95883cd382c2ee75664d58f39377
|
||||||
pop: d582054913807fd11fd50bfe6a539d91c7e1a55a
|
pop: d582054913807fd11fd50bfe6a539d91c7e1a55a
|
||||||
Qiniu: 61f1e2fdfb35b37f98c8f03a718faf12652f9994
|
Qiniu: 61f1e2fdfb35b37f98c8f03a718faf12652f9994
|
||||||
@@ -131,6 +135,6 @@ SPEC CHECKSUMS:
|
|||||||
SZTextView: 094dc6acc9beec537685c545d6e3e0d4975174e1
|
SZTextView: 094dc6acc9beec537685c545d6e3e0d4975174e1
|
||||||
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
|
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
|
||||||
|
|
||||||
PODFILE CHECKSUM: db33c042062a7ccc33a5468e35a1c606fb3f4e98
|
PODFILE CHECKSUM: 6968a06e7b791226635261958cf107f1af64fadf
|
||||||
|
|
||||||
COCOAPODS: 1.10.1
|
COCOAPODS: 1.10.1
|
||||||
|
@@ -140,6 +140,10 @@
|
|||||||
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308826E89BE000B90D4F /* LoginPhoneViewController.m */; };
|
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308826E89BE000B90D4F /* LoginPhoneViewController.m */; };
|
||||||
E872308D26E89DAA00B90D4F /* LoginInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308C26E89DAA00B90D4F /* LoginInputView.m */; };
|
E872308D26E89DAA00B90D4F /* LoginInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308C26E89DAA00B90D4F /* LoginInputView.m */; };
|
||||||
E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872309226E8D31500B90D4F /* LoginVerifCodeView.m */; };
|
E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872309226E8D31500B90D4F /* LoginVerifCodeView.m */; };
|
||||||
|
E874B86C272105DD003954B9 /* XPIMManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B86B272105DD003954B9 /* XPIMManager.m */; };
|
||||||
|
E874B8702721067A003954B9 /* XPIMLoginImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B86F2721067A003954B9 /* XPIMLoginImpl.m */; };
|
||||||
|
E874B873272108DB003954B9 /* XPIMLoginDelegate.h in Sources */ = {isa = PBXBuildFile; fileRef = E874B872272106B3003954B9 /* XPIMLoginDelegate.h */; };
|
||||||
|
E874B874272108ED003954B9 /* XPIMLoginInterface.h in Sources */ = {isa = PBXBuildFile; fileRef = E874B87127210699003954B9 /* XPIMLoginInterface.h */; };
|
||||||
E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */; };
|
E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */; };
|
||||||
E88B5CA826FB089C00DA9178 /* XPMineTeenagePwdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA726FB089C00DA9178 /* XPMineTeenagePwdViewController.m */; };
|
E88B5CA826FB089C00DA9178 /* XPMineTeenagePwdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA726FB089C00DA9178 /* XPMineTeenagePwdViewController.m */; };
|
||||||
E88B5CAD26FB16A800DA9178 /* XPMineTeenagerDesView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CAC26FB16A800DA9178 /* XPMineTeenagerDesView.m */; };
|
E88B5CAD26FB16A800DA9178 /* XPMineTeenagerDesView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CAC26FB16A800DA9178 /* XPMineTeenagerDesView.m */; };
|
||||||
@@ -491,6 +495,12 @@
|
|||||||
E872308C26E89DAA00B90D4F /* LoginInputView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginInputView.m; sourceTree = "<group>"; };
|
E872308C26E89DAA00B90D4F /* LoginInputView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginInputView.m; sourceTree = "<group>"; };
|
||||||
E872309126E8D31500B90D4F /* LoginVerifCodeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginVerifCodeView.h; sourceTree = "<group>"; };
|
E872309126E8D31500B90D4F /* LoginVerifCodeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginVerifCodeView.h; sourceTree = "<group>"; };
|
||||||
E872309226E8D31500B90D4F /* LoginVerifCodeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginVerifCodeView.m; sourceTree = "<group>"; };
|
E872309226E8D31500B90D4F /* LoginVerifCodeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginVerifCodeView.m; sourceTree = "<group>"; };
|
||||||
|
E874B86A272105DD003954B9 /* XPIMManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMManager.h; sourceTree = "<group>"; };
|
||||||
|
E874B86B272105DD003954B9 /* XPIMManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPIMManager.m; sourceTree = "<group>"; };
|
||||||
|
E874B86E2721067A003954B9 /* XPIMLoginImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMLoginImpl.h; sourceTree = "<group>"; };
|
||||||
|
E874B86F2721067A003954B9 /* XPIMLoginImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPIMLoginImpl.m; sourceTree = "<group>"; };
|
||||||
|
E874B87127210699003954B9 /* XPIMLoginInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMLoginInterface.h; sourceTree = "<group>"; };
|
||||||
|
E874B872272106B3003954B9 /* XPIMLoginDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMLoginDelegate.h; sourceTree = "<group>"; };
|
||||||
E88B5CA326FB088600DA9178 /* XPMineTeenagerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagerViewController.h; sourceTree = "<group>"; };
|
E88B5CA326FB088600DA9178 /* XPMineTeenagerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagerViewController.h; sourceTree = "<group>"; };
|
||||||
E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineTeenagerViewController.m; sourceTree = "<group>"; };
|
E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineTeenagerViewController.m; sourceTree = "<group>"; };
|
||||||
E88B5CA626FB089C00DA9178 /* XPMineTeenagePwdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagePwdViewController.h; sourceTree = "<group>"; };
|
E88B5CA626FB089C00DA9178 /* XPMineTeenagePwdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagePwdViewController.h; sourceTree = "<group>"; };
|
||||||
@@ -948,6 +958,7 @@
|
|||||||
189DD56126DE45F800AB55B1 /* Main */ = {
|
189DD56126DE45F800AB55B1 /* Main */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
E874B869272105C0003954B9 /* IM */,
|
||||||
18486210271EA9A5005FC5DC /* RTC */,
|
18486210271EA9A5005FC5DC /* RTC */,
|
||||||
E8AEAED3271412D00017FCE0 /* Room */,
|
E8AEAED3271412D00017FCE0 /* Room */,
|
||||||
E8E70D6E26F2EB1200F03460 /* Mine */,
|
E8E70D6E26F2EB1200F03460 /* Mine */,
|
||||||
@@ -1396,6 +1407,27 @@
|
|||||||
path = CustomView;
|
path = CustomView;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
E874B869272105C0003954B9 /* IM */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
E874B86D2721064E003954B9 /* Login */,
|
||||||
|
E874B86A272105DD003954B9 /* XPIMManager.h */,
|
||||||
|
E874B86B272105DD003954B9 /* XPIMManager.m */,
|
||||||
|
);
|
||||||
|
path = IM;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
E874B86D2721064E003954B9 /* Login */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
E874B86E2721067A003954B9 /* XPIMLoginImpl.h */,
|
||||||
|
E874B86F2721067A003954B9 /* XPIMLoginImpl.m */,
|
||||||
|
E874B87127210699003954B9 /* XPIMLoginInterface.h */,
|
||||||
|
E874B872272106B3003954B9 /* XPIMLoginDelegate.h */,
|
||||||
|
);
|
||||||
|
path = Login;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
E88B5CA926FB15B900DA9178 /* Teenager */ = {
|
E88B5CA926FB15B900DA9178 /* Teenager */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -1969,6 +2001,8 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
E874B874272108ED003954B9 /* XPIMLoginInterface.h in Sources */,
|
||||||
|
E874B873272108DB003954B9 /* XPIMLoginDelegate.h in Sources */,
|
||||||
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
|
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
|
||||||
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */,
|
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */,
|
||||||
E8EEB91126FC6AE2007C6EBA /* XPMineUserInfoEditProtocol.h in Sources */,
|
E8EEB91126FC6AE2007C6EBA /* XPMineUserInfoEditProtocol.h in Sources */,
|
||||||
@@ -2022,6 +2056,7 @@
|
|||||||
E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */,
|
E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */,
|
||||||
E89DA67827009F16008483C1 /* NSObject+JSONString.m in Sources */,
|
E89DA67827009F16008483C1 /* NSObject+JSONString.m in Sources */,
|
||||||
E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */,
|
E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */,
|
||||||
|
E874B86C272105DD003954B9 /* XPIMManager.m in Sources */,
|
||||||
E81C279D26EEEC620031E639 /* XPConstant.m in Sources */,
|
E81C279D26EEEC620031E639 /* XPConstant.m in Sources */,
|
||||||
187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */,
|
187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */,
|
||||||
E8AC721926F46E0B007D6E91 /* XPMineSettingItemModel.m in Sources */,
|
E8AC721926F46E0B007D6E91 /* XPMineSettingItemModel.m in Sources */,
|
||||||
@@ -2091,6 +2126,7 @@
|
|||||||
E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */,
|
E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */,
|
||||||
E8AC722C26F49580007D6E91 /* XPMineNotificaViewController.m in Sources */,
|
E8AC722C26F49580007D6E91 /* XPMineNotificaViewController.m in Sources */,
|
||||||
189DD52E26DE255300AB55B1 /* AppDelegate.m in Sources */,
|
189DD52E26DE255300AB55B1 /* AppDelegate.m in Sources */,
|
||||||
|
E874B8702721067A003954B9 /* XPIMLoginImpl.m in Sources */,
|
||||||
E88F5EB0271ECEF000FF9B33 /* XPRoomViewController+RoomInfoContainerView.m in Sources */,
|
E88F5EB0271ECEF000FF9B33 /* XPRoomViewController+RoomInfoContainerView.m in Sources */,
|
||||||
E86596542701A55500846EBD /* StatisticsServiceHelper.m in Sources */,
|
E86596542701A55500846EBD /* StatisticsServiceHelper.m in Sources */,
|
||||||
E8E70D8C26F2F5A500F03460 /* XPMineMatchCollectionViewCell.m in Sources */,
|
E8E70D8C26F2F5A500F03460 /* XPMineMatchCollectionViewCell.m in Sources */,
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#import "AppDelegate+ThirdConfig.h"
|
#import "AppDelegate+ThirdConfig.h"
|
||||||
///Third
|
///Third
|
||||||
#import <ShareSDK/ShareSDK.h>
|
#import <ShareSDK/ShareSDK.h>
|
||||||
|
#import <NIMSDK/NIMSDK.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "XPConstant.h"
|
#import "XPConstant.h"
|
||||||
|
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
/// 初始化一些第三方配置
|
/// 初始化一些第三方配置
|
||||||
- (void)initThirdConfig {
|
- (void)initThirdConfig {
|
||||||
[self configShareSDK];
|
[self configShareSDK];
|
||||||
|
[self configNIMSDK];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)configShareSDK {
|
- (void)configShareSDK {
|
||||||
@@ -29,4 +31,12 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)configNIMSDK {
|
||||||
|
//推荐在程序启动的时候初始化 NIMSDK
|
||||||
|
NSString *appKey = KeyWithType(KeyType_NetEase);
|
||||||
|
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
|
||||||
|
option.apnsCername = KeyWithType(KeyType_APNSCer);
|
||||||
|
[[NIMSDK sharedSDK] registerWithOption:option];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -23,6 +23,8 @@ typedef NS_ENUM(NSUInteger, KeyType) {
|
|||||||
KeyType_WechatAppid,///微信的 appid
|
KeyType_WechatAppid,///微信的 appid
|
||||||
KeyType_WechatSecret,///微信的 secret
|
KeyType_WechatSecret,///微信的 secret
|
||||||
KeyType_Agora,///声网 key
|
KeyType_Agora,///声网 key
|
||||||
|
KeyType_NetEase,///云信的key
|
||||||
|
KeyType_APNSCer,///推送证书的名字
|
||||||
};
|
};
|
||||||
|
|
||||||
/// 获取当前项目中所用到的 type 所对应的 value 的值 type 类型
|
/// 获取当前项目中所用到的 type 所对应的 value 的值 type 类型
|
||||||
|
@@ -15,7 +15,8 @@ NSString * const kWeChatNumber = @"yinyoucc";
|
|||||||
|
|
||||||
///在里面进行判断当前环境是什么
|
///在里面进行判断当前环境是什么
|
||||||
NSString * const KeyWithType(KeyType type) {
|
NSString * const KeyWithType(KeyType type) {
|
||||||
BOOL isRelease = YES;
|
#warning to do 需要根据当前环境进行判断
|
||||||
|
BOOL isRelease = NO;
|
||||||
NSDictionary * dic = @{
|
NSDictionary * dic = @{
|
||||||
///正式环境
|
///正式环境
|
||||||
@(YES):@{
|
@(YES):@{
|
||||||
@@ -26,6 +27,8 @@ NSString * const KeyWithType(KeyType type) {
|
|||||||
@(KeyType_WechatAppid) : @"wx3f0462eb7eccd64f",
|
@(KeyType_WechatAppid) : @"wx3f0462eb7eccd64f",
|
||||||
@(KeyType_WechatSecret) : @"1c07949e3f53433f1c6038bfcdd54c40",
|
@(KeyType_WechatSecret) : @"1c07949e3f53433f1c6038bfcdd54c40",
|
||||||
@(KeyType_Agora) : @"7ae1a8dabe7a44a9a67c829faa409e70",
|
@(KeyType_Agora) : @"7ae1a8dabe7a44a9a67c829faa409e70",
|
||||||
|
@(KeyType_NetEase) : @"14ef7a0d0a84cb49bae1c22d78cf1ddf",
|
||||||
|
@(KeyType_APNSCer) : @"yinyouApnsRelease",
|
||||||
},
|
},
|
||||||
///测试环境
|
///测试环境
|
||||||
@(NO):@{
|
@(NO):@{
|
||||||
@@ -36,6 +39,8 @@ NSString * const KeyWithType(KeyType type) {
|
|||||||
@(KeyType_WechatAppid) : @"wx3f0462eb7eccd64f",
|
@(KeyType_WechatAppid) : @"wx3f0462eb7eccd64f",
|
||||||
@(KeyType_WechatSecret) : @"1c07949e3f53433f1c6038bfcdd54c40",
|
@(KeyType_WechatSecret) : @"1c07949e3f53433f1c6038bfcdd54c40",
|
||||||
@(KeyType_Agora) : @"7ae1a8dabe7a44a9a67c829faa409e70",
|
@(KeyType_Agora) : @"7ae1a8dabe7a44a9a67c829faa409e70",
|
||||||
|
@(KeyType_NetEase) : @"82a8d602aacbbb27a1c0fc809052286e",
|
||||||
|
@(KeyType_APNSCer) : @"yinyouApnsDebug",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
NSDictionary * enviroDic = [dic objectForKey:@(isRelease)];
|
NSDictionary * enviroDic = [dic objectForKey:@(isRelease)];
|
||||||
|
27
xplan-ios/Main/IM/Login/XPIMLoginDelegate.h
Normal file
27
xplan-ios/Main/IM/Login/XPIMLoginDelegate.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// XPIMLoginDelegate.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2021/10/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@protocol XPIMLoginDelegate <NSObject>
|
||||||
|
@optional
|
||||||
|
///云信登录成功
|
||||||
|
- (void)imLoginSuccess;
|
||||||
|
///云信数据同步成功
|
||||||
|
- (void)imSyncSuccess;
|
||||||
|
///云信登录失败
|
||||||
|
- (void)imLoginFail;
|
||||||
|
/// 被踢(服务器/其他端)回调
|
||||||
|
- (void)imKickOut:(NSString*)reason;
|
||||||
|
///退出登录成功
|
||||||
|
- (void)imLogoutSuccess;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
16
xplan-ios/Main/IM/Login/XPIMLoginImpl.h
Normal file
16
xplan-ios/Main/IM/Login/XPIMLoginImpl.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// XPIMLoginImpl.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2021/10/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "XPIMLoginInterface.h"
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface XPIMLoginImpl : NSObject<XPIMLoginInterface>
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
119
xplan-ios/Main/IM/Login/XPIMLoginImpl.m
Normal file
119
xplan-ios/Main/IM/Login/XPIMLoginImpl.m
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
//
|
||||||
|
// XPIMLoginImpl.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2021/10/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPIMLoginImpl.h"
|
||||||
|
///Third
|
||||||
|
#import <NIMSDK/NIMSDK.h>
|
||||||
|
///P
|
||||||
|
#import "XPIMLoginDelegate.h"
|
||||||
|
///Tool
|
||||||
|
|
||||||
|
@interface XPIMLoginImpl ()<XPIMLoginInterface, NIMLoginManagerDelegate>
|
||||||
|
///回调的代理
|
||||||
|
@property (nonatomic,strong) id<XPIMLoginDelegate> delegate;
|
||||||
|
///账号id
|
||||||
|
@property (nonatomic,copy) NSString *account;
|
||||||
|
///token
|
||||||
|
@property (nonatomic,copy) NSString *token;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation XPIMLoginImpl
|
||||||
|
- (instancetype)init {
|
||||||
|
self = [super init];
|
||||||
|
if (self) {
|
||||||
|
[[NIMSDK sharedSDK].loginManager addDelegate:self];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark - Private Method
|
||||||
|
///是否可以响应某个方法
|
||||||
|
- (BOOL)canRespondsToSelector:(SEL)aSelector{
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:aSelector]){
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - XPIMLoginInterface
|
||||||
|
- (void)autoLoginIm:(NSString *)account token:(NSString *)token {
|
||||||
|
self.account = account;
|
||||||
|
self.token = token;
|
||||||
|
NIMAutoLoginData *data = [[NIMAutoLoginData alloc] init];
|
||||||
|
data.account = account;
|
||||||
|
data.token = token;
|
||||||
|
data.forcedMode = NO;
|
||||||
|
[[NIMSDK sharedSDK].loginManager autoLogin:data];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)logoutIm {
|
||||||
|
[[NIMSDK sharedSDK].loginManager logout:^(NSError * _Nullable error) {
|
||||||
|
if (error == nil) {
|
||||||
|
self.account = nil;
|
||||||
|
self.token = nil;
|
||||||
|
if ([self canRespondsToSelector:@selector(imLogoutSuccess)]) {
|
||||||
|
[self.delegate imLogoutSuccess];
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addDelegate:(id<XPIMLoginDelegate>)delegate {
|
||||||
|
self.delegate = delegate;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeDelegate:(id<XPIMLoginDelegate>)delegate {
|
||||||
|
self.delegate = nil;
|
||||||
|
[[NIMSDK sharedSDK].loginManager removeDelegate:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - NIMLoginManagerDelegate
|
||||||
|
/// 登录的回调
|
||||||
|
/// @param step 登录是否成功
|
||||||
|
- (void)onLogin:(NIMLoginStep)step{
|
||||||
|
if (step == NIMLoginStepLoginOK) {
|
||||||
|
// 云信登录成功
|
||||||
|
if ([self canRespondsToSelector:@selector(imLoginSuccess)] ) {
|
||||||
|
[self.delegate imLoginSuccess];
|
||||||
|
}
|
||||||
|
} else if (step == NIMLoginStepSyncOK) {
|
||||||
|
if ([self canRespondsToSelector:@selector(imSyncSuccess)]) {
|
||||||
|
[self.delegate imSyncSuccess];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 自动登录失败
|
||||||
|
/// @param error 失败的erro
|
||||||
|
- (void)onAutoLoginFailed:(NSError *)error{
|
||||||
|
///服务器将检查当前登录设备是否为上一次登录设备,如果不是,服务器将拒绝这次自动登录(返回 error code 为 417 的错误);强制模式下的自动登录,服务器将不检查当前登录设备是否为上一次登录设备,安全性较低,但较为便捷。
|
||||||
|
if (error.code == 417) {
|
||||||
|
[[NIMSDK sharedSDK].loginManager login:self.account token:self.token completion:^(NSError * _Nullable error) {
|
||||||
|
if (error == nil) {
|
||||||
|
[self.delegate imLoginFail];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ([self canRespondsToSelector:@selector(imLoginFail)]) {
|
||||||
|
[self.delegate imLoginFail];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 被踢(服务器/其他端)回调
|
||||||
|
/// @param result 被踢的原因
|
||||||
|
- (void)onKickout:(NIMLoginKickoutResult *)result {
|
||||||
|
if ([self canRespondsToSelector:@selector(imKickOut:)]) {
|
||||||
|
[self.delegate imKickOut:result.reasonDesc];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
23
xplan-ios/Main/IM/Login/XPIMLoginInterface.h
Normal file
23
xplan-ios/Main/IM/Login/XPIMLoginInterface.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// XPIMLoginInterface.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2021/10/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "XPIMLoginDelegate.h"
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@protocol XPIMLoginInterface <NSObject>
|
||||||
|
///自动登录
|
||||||
|
- (void)autoLoginIm:(NSString *)account token:(NSString *)token;
|
||||||
|
///退出登录im
|
||||||
|
- (void)logoutIm;
|
||||||
|
///添加代理
|
||||||
|
- (void)addDelegate:(id<XPIMLoginDelegate>)delegate;
|
||||||
|
///移除代理
|
||||||
|
- (void)removeDelegate:(id<XPIMLoginDelegate>)delegate;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
19
xplan-ios/Main/IM/XPIMManager.h
Normal file
19
xplan-ios/Main/IM/XPIMManager.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// XPIMManager.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2021/10/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "XPIMLoginInterface.h"
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface XPIMManager : NSObject
|
||||||
|
+ (instancetype)shareManager;
|
||||||
|
///im登录的协议
|
||||||
|
@property (nonatomic,strong, readonly) id<XPIMLoginInterface> imLoginManager;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
34
xplan-ios/Main/IM/XPIMManager.m
Normal file
34
xplan-ios/Main/IM/XPIMManager.m
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
//
|
||||||
|
// XPIMManager.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2021/10/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPIMManager.h"
|
||||||
|
#import "XPIMLoginImpl.h"
|
||||||
|
@interface XPIMManager ()
|
||||||
|
///
|
||||||
|
@property (nonatomic,strong) id<XPIMLoginInterface> imLoginManager;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation XPIMManager
|
||||||
|
|
||||||
|
+ (instancetype)shareManager {
|
||||||
|
static dispatch_once_t onceToken;
|
||||||
|
static XPIMManager * manager;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
|
manager = [[XPIMManager alloc] init];
|
||||||
|
});
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (id<XPIMLoginInterface>)imLoginManager {
|
||||||
|
if (!_imLoginManager) {
|
||||||
|
_imLoginManager = [[XPIMLoginImpl alloc] init];
|
||||||
|
}
|
||||||
|
return _imLoginManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@@ -69,6 +69,7 @@
|
|||||||
_engineDelegate = delegate;
|
_engineDelegate = delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id<RtcInterface>)engine {
|
- (id<RtcInterface>)engine {
|
||||||
if (!_engine) {
|
if (!_engine) {
|
||||||
switch (_engineType) {
|
switch (_engineType) {
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
///Third
|
///Third
|
||||||
#import <flutter_boost/FlutterBoost.h>
|
#import <flutter_boost/FlutterBoost.h>
|
||||||
|
#import <ReactiveObjC/ReactiveObjC.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "XPMacro.h"
|
#import "XPMacro.h"
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
@@ -14,6 +15,9 @@
|
|||||||
#import "XCHUDTool.h"
|
#import "XCHUDTool.h"
|
||||||
#import "RechargeStorage.h"
|
#import "RechargeStorage.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
|
#import "XPIMManager.h"
|
||||||
|
///Model
|
||||||
|
#import "AccountModel.h"
|
||||||
///VC
|
///VC
|
||||||
#import "TabbarViewController.h"
|
#import "TabbarViewController.h"
|
||||||
#import "BaseViewController.h"
|
#import "BaseViewController.h"
|
||||||
@@ -26,10 +30,11 @@
|
|||||||
///Present
|
///Present
|
||||||
#import "MainPresenter.h"
|
#import "MainPresenter.h"
|
||||||
#import "MainProtocol.h"
|
#import "MainProtocol.h"
|
||||||
|
#import "XPIMLoginDelegate.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol>
|
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol, XPIMLoginDelegate>
|
||||||
|
|
||||||
@property (nonatomic, strong) MainPresenter *presenter;
|
@property (nonatomic, strong) MainPresenter *presenter;
|
||||||
|
|
||||||
@@ -37,10 +42,15 @@
|
|||||||
|
|
||||||
@implementation TabbarViewController
|
@implementation TabbarViewController
|
||||||
|
|
||||||
|
- (void)dealloc {
|
||||||
|
[[XPIMManager shareManager].imLoginManager removeDelegate:self];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[self configTheme];
|
[self configTheme];
|
||||||
[self initTabs:NO];
|
[self initTabs:NO];
|
||||||
|
[self configImDelegate];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewWillAppear:(BOOL)animated {
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
@@ -100,6 +110,12 @@
|
|||||||
[RechargeStorage delegateAllTranscationIdsWithUid:uid];
|
[RechargeStorage delegateAllTranscationIdsWithUid:uid];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - XPIMLoginDelegate
|
||||||
|
///用户被踢
|
||||||
|
- (void)imKickOut:(NSString *)reason {
|
||||||
|
[self tokenInvalid];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - 批量验证内购凭据
|
#pragma mark - 批量验证内购凭据
|
||||||
- (void)checkTranscationIds {
|
- (void)checkTranscationIds {
|
||||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
@@ -117,6 +133,16 @@
|
|||||||
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
[self.navigationController presentViewController:nav animated:YES completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)configImDelegate {
|
||||||
|
[[XPIMManager shareManager].imLoginManager addDelegate:self];
|
||||||
|
[RACObserve([AccountInfoStorage instance], accountModel) subscribeNext:^(id _Nullable x) {
|
||||||
|
if (x) {
|
||||||
|
AccountModel * model = x;
|
||||||
|
[[XPIMManager shareManager].imLoginManager autoLoginIm:model.uid token:model.netEaseToken];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)configTheme {
|
- (void)configTheme {
|
||||||
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[ThemeColor appCellBackgroundColor] size:CGSizeMake(KScreenWidth, kTabBarHeight)]];
|
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[ThemeColor appCellBackgroundColor] size:CGSizeMake(KScreenWidth, kTabBarHeight)]];
|
||||||
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
|
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
|
||||||
|
Reference in New Issue
Block a user