diff --git a/ios-sealtalk/PodShell.sh b/ios-sealtalk/PodShell.sh index df770151..a21c0540 100755 --- a/ios-sealtalk/PodShell.sh +++ b/ios-sealtalk/PodShell.sh @@ -18,6 +18,7 @@ sed -i '' -e '/path = RongCloudTests;/d' ${Project} sed -i '' -e "/\/\* ShellScript \*\/ = {/,/};/d" ${Project} # 2. 删除敏感信息 +sed -i "" -e 's?^#define DORAEMON_APPID.*$?#define DORAEMON_APPID @\"\"?' RCloudMessage/AppDelegate.m sed -i "" -e 's?^#define BUGLY_APPID.*$?#define BUGLY_APPID @\"\"?' RCloudMessage/AppDelegate.m sed -i "" -e 's?^#define RONGCLOUD_STATUS_SERVER.*$?#define RONGCLOUD_STATUS_SERVER @\"\"?' RCloudMessage/AppDelegate.m diff --git a/ios-sealtalk/Podfile b/ios-sealtalk/Podfile index d208bb40..01f76e56 100644 --- a/ios-sealtalk/Podfile +++ b/ios-sealtalk/Podfile @@ -13,10 +13,16 @@ target 'SealTalk' do pod 'SDWebImage', '5.0.6' pod 'Bugly', '2.5.0' pod 'WechatOpenSDK', '1.8.4' - pod 'RongCloudIM/IMLib', '4.0.1' - pod 'RongCloudIM/IMKit', '4.0.1' - pod 'RongCloudIM/RongSticker', '4.0.1' - pod 'RongCloudIM/Sight', '4.0.1' - pod 'RongCloudRTC/RongCallLib', '4.0.1' - pod 'RongCloudRTC/RongCallKit', '4.0.1' + + pod 'DoraemonKit/Core', '~> 3.0.2', :configurations => ['Debug'] 必选 + pod 'DoraemonKit/WithGPS', '~> 3.0.2', :configurations => ['Debug'] 模拟定位 + pod 'DoraemonKit/WithLoad', '~> 3.0.2', :configurations => ['Debug'] Load耗时检测 + pod 'DoraemonKit/WithMLeaksFinder', '~> 3.0.2', :configurations => ['Debug'] 查找内存泄漏 + + pod 'RongCloudIM/IMLib', '4.0.2' + pod 'RongCloudIM/IMKit', '4.0.2' + pod 'RongCloudIM/RongSticker', '4.0.2' + pod 'RongCloudIM/Sight', '4.0.2' + pod 'RongCloudRTC/RongCallLib', '4.0.2' + pod 'RongCloudRTC/RongCallKit', '4.0.2' end diff --git a/ios-sealtalk/RCloudMessage.xcodeproj/project.pbxproj b/ios-sealtalk/RCloudMessage.xcodeproj/project.pbxproj index ddba3fdd..c86a8f3e 100755 --- a/ios-sealtalk/RCloudMessage.xcodeproj/project.pbxproj +++ b/ios-sealtalk/RCloudMessage.xcodeproj/project.pbxproj @@ -3082,6 +3082,8 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-SealTalk/Pods-SealTalk-frameworks.sh", "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", + "${BUILT_PRODUCTS_DIR}/DoraemonKit/DoraemonKit.framework", + "${PODS_ROOT}/DoraemonKit/iOS/DoraemonKit/Framework/DoraemonLoadAnalyze.framework", "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", "${BUILT_PRODUCTS_DIR}/GCDWebServer/GCDWebServer.framework", "${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework", @@ -3093,6 +3095,8 @@ name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoraemonKit.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoraemonLoadAnalyze.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GCDWebServer.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework", @@ -3549,7 +3553,7 @@ OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im.shareextension; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = $SHARE_PROFILE; + PROVISIONING_PROFILE = "$SHARE_PROFILE"; SKIP_INSTALL = YES; }; name = AutoDebug; @@ -3595,7 +3599,7 @@ OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im.shareextension; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = $SHARE_PROFILE; + PROVISIONING_PROFILE = "$SHARE_PROFILE"; SKIP_INSTALL = YES; }; name = AutoRelease; @@ -3640,7 +3644,7 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ""; - PROVISIONING_PROFILE = $APP_PROFILE; + PROVISIONING_PROFILE = "$APP_PROFILE"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 armv7s arm64"; @@ -3698,7 +3702,7 @@ OTHER_LIBTOOLFLAGS = "$(OTHER_LDFLAGS)"; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im; PRODUCT_NAME = SealTalk; - PROVISIONING_PROFILE = $APP_PROFILE; + PROVISIONING_PROFILE = "$APP_PROFILE"; VALID_ARCHS = "armv7 armv7s arm64"; }; name = AutoDebug; @@ -3732,7 +3736,7 @@ OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im.wkextension; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = $WATCHKIT_EXTENSION_PROFILE; + PROVISIONING_PROFILE = "$WATCHKIT_EXTENSION_PROFILE"; SKIP_INSTALL = YES; }; name = AutoDebug; @@ -3752,13 +3756,13 @@ "DEBUG=1", "$(inherited)", ); - IBSC_MODULE = "___Demo_WatchKit_Extension"; + IBSC_MODULE = ___Demo_WatchKit_Extension; INFOPLIST_FILE = "融云 Demo WatchKit App/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.2; OTHER_CFLAGS = "-fembed-bitcode"; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = $WATCHKIT_APP_PROFILE; + PROVISIONING_PROFILE = "$WATCHKIT_APP_PROFILE"; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 4; "TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*]" = "1,4"; @@ -3799,7 +3803,7 @@ MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ""; - PROVISIONING_PROFILE = $APP_PROFILE; + PROVISIONING_PROFILE = "$APP_PROFILE"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -3858,7 +3862,7 @@ OTHER_LIBTOOLFLAGS = "$(OTHER_LDFLAGS)"; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im; PRODUCT_NAME = SealTalk; - PROVISIONING_PROFILE = $APP_PROFILE; + PROVISIONING_PROFILE = "$APP_PROFILE"; VALID_ARCHS = "armv7 armv7s arm64"; }; name = AutoRelease; @@ -3889,7 +3893,7 @@ OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im.wkextension; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = $WATCHKIT_EXTENSION_PROFILE; + PROVISIONING_PROFILE = "$WATCHKIT_EXTENSION_PROFILE"; SKIP_INSTALL = YES; }; name = AutoRelease; @@ -3906,13 +3910,13 @@ DEVELOPMENT_TEAM = 9CVMN4UZK4; ENABLE_BITCODE = NO; GCC_NO_COMMON_BLOCKS = YES; - IBSC_MODULE = "___Demo_WatchKit_Extension"; + IBSC_MODULE = ___Demo_WatchKit_Extension; INFOPLIST_FILE = "融云 Demo WatchKit App/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.2; OTHER_CFLAGS = "-fembed-bitcode"; PRODUCT_BUNDLE_IDENTIFIER = cn.rongcloud.im.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = $WATCHKIT_APP_PROFILE; + PROVISIONING_PROFILE = "$WATCHKIT_APP_PROFILE"; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 4; "TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*]" = "1,4"; @@ -3999,7 +4003,7 @@ "DEBUG=1", "$(inherited)", ); - IBSC_MODULE = "___Demo_WatchKit_Extension"; + IBSC_MODULE = ___Demo_WatchKit_Extension; INFOPLIST_FILE = "融云 Demo WatchKit App/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.2; OTHER_CFLAGS = "-fembed-bitcode"; @@ -4024,7 +4028,7 @@ DEVELOPMENT_TEAM = 9CVMN4UZK4; ENABLE_BITCODE = NO; GCC_NO_COMMON_BLOCKS = YES; - IBSC_MODULE = "___Demo_WatchKit_Extension"; + IBSC_MODULE = ___Demo_WatchKit_Extension; INFOPLIST_FILE = "融云 Demo WatchKit App/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.2; OTHER_CFLAGS = "-fembed-bitcode"; diff --git a/ios-sealtalk/RCloudMessage/AppDelegate.m b/ios-sealtalk/RCloudMessage/AppDelegate.m index 7a25d8e8..b2212eb5 100644 --- a/ios-sealtalk/RCloudMessage/AppDelegate.m +++ b/ios-sealtalk/RCloudMessage/AppDelegate.m @@ -34,6 +34,11 @@ #import "RCDPokeManager.h" #import "RCDClearMessage.h" +#ifdef DEBUG +#import +#endif + +#define DORAEMON_APPID @"" #define BUGLY_APPID @"" #define LOG_EXPIRE_TIME -7 * 24 * 60 * 60 @@ -54,6 +59,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [self configRongIM]; [self configWeChatShare]; [self loginAndEnterMainPage]; + [self configDoraemon]; + return YES; } @@ -115,6 +122,12 @@ - (void)configWeChatShare { [RCDWeChatManager registerApp:WECHAT_APPID]; } +- (void)configDoraemon { + #ifdef DEBUG + [[DoraemonManager shareInstance] installWithPid:DORAEMON_APPID]; + #endif +} + - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { return [[RCDWeChatManager sharedManager] handleOpenURL:url]; diff --git a/ios-sealtalk/RCloudMessage/Sections/Debug/ChatroomStatus/RCDDebugChatroomViewController.m b/ios-sealtalk/RCloudMessage/Sections/Debug/ChatroomStatus/RCDDebugChatroomViewController.m index 6ef6ce0a..716a65ad 100644 --- a/ios-sealtalk/RCloudMessage/Sections/Debug/ChatroomStatus/RCDDebugChatroomViewController.m +++ b/ios-sealtalk/RCloudMessage/Sections/Debug/ChatroomStatus/RCDDebugChatroomViewController.m @@ -14,7 +14,7 @@ static NSString *debugChatRoomCellIdentifier = @"RCDDebugChatRoomCellIdentifier"; -@interface RCDDebugChatroomViewController () +@interface RCDDebugChatroomViewController () @property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) NSMutableArray *dataArray; @@ -275,6 +275,47 @@ - (void)didReceiveMessageNotification:(NSNotification *)notification { } } +#pragma mark - RCChatRoomKVStatusChangeDelegate +- (void)chatRoomKVDidSync:(NSString *)roomId { + NSLog(@"chatRoomKVDidSync --- roomId:%@", roomId); + NSString *targetString = [NSString stringWithFormat:@"chatRoomKVDidSync:%@", roomId]; + [self addStringToDataSource:targetString]; +} + +- (void)chatRoomKVDidUpdate:(NSString *)roomId entry:(NSDictionary *)entry { + NSLog(@"chatRoomKVDidUpdate --- roomId:%@,entry:%@", roomId, entry); + NSString *jsonString = @""; + NSError *error = nil; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:entry + options:NSJSONWritingPrettyPrinted + error:&error]; + if (error) { + jsonString = [entry description]; + } + jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; + NSString *targetString = + [NSString stringWithFormat:@"chatRoomKVDidUpdate:共 %lu 个,\n roomId:%@,entry:%@", + (unsigned long)entry.count, roomId, jsonString]; + [self addStringToDataSource:targetString]; +} + +- (void)chatRoomKVDidRemove:(NSString *)roomId entry:(NSDictionary *)entry { + NSLog(@"chatRoomKVDidRemove --- roomId:%@,entry:%@", roomId, entry); + NSString *jsonString = @""; + NSError *error = nil; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:entry + options:NSJSONWritingPrettyPrinted + error:&error]; + if (error) { + jsonString = [entry description]; + } + jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; + NSString *targetString = + [NSString stringWithFormat:@"chatRoomKVDidRemove:共 %lu 个,\n roomId:%@,entry:%@", + (unsigned long)entry.count, roomId, jsonString]; + [self addStringToDataSource:targetString]; +} + #pragma mark - Private Method - (void)setupData { @@ -284,6 +325,8 @@ - (void)setupData { object:nil]; [self addStringToDataSource:[NSString stringWithFormat:@"加入聊天室:%@", self.roomId]]; + + [[RCIMClient sharedRCIMClient] setRCChatRoomKVStatusChangeDelegate:self]; } - (void)setupNav { diff --git a/ios-sealtalk/RCloudMessage/Sections/Login/RCDCountry.m b/ios-sealtalk/RCloudMessage/Sections/Login/RCDCountry.m index 27ebbc22..b42e4475 100644 --- a/ios-sealtalk/RCloudMessage/Sections/Login/RCDCountry.m +++ b/ios-sealtalk/RCloudMessage/Sections/Login/RCDCountry.m @@ -15,7 +15,7 @@ @implementation RCDCountry - (instancetype)initWithDict:(NSDictionary *)dict { self = [super init]; if (self) { - self.phoneCode = [dict objectForKey:@"region"]; + self.phoneCode = [dict objectForKey:@"region"]?:@"86"; NSDictionary *locale = [dict objectForKey:@"locale"]; self.locale = locale; } diff --git a/ios-sealtalk/RCloudMessage/Supporting Files/Info.plist b/ios-sealtalk/RCloudMessage/Supporting Files/Info.plist index faabcadf..35cd253b 100644 --- a/ios-sealtalk/RCloudMessage/Supporting Files/Info.plist +++ b/ios-sealtalk/RCloudMessage/Supporting Files/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.0.1 Dev + 4.0.2 Dev CFBundleSignature ???? CFBundleURLTypes @@ -52,7 +52,7 @@ CFBundleVersion - 202007201755 + 202008191835 LSApplicationQueriesSchemes weixin @@ -77,7 +77,7 @@ NSPhotoLibraryUsageDescription 访问相册 SealTalk Version - 4.0.1 + 4.0.2 UIBackgroundModes audio diff --git a/ios-sealtalk/RCloudMessage/Utils/HTTP/RCDHTTPUtility.m b/ios-sealtalk/RCloudMessage/Utils/HTTP/RCDHTTPUtility.m index 9314efe8..834def58 100644 --- a/ios-sealtalk/RCloudMessage/Utils/HTTP/RCDHTTPUtility.m +++ b/ios-sealtalk/RCloudMessage/Utils/HTTP/RCDHTTPUtility.m @@ -42,6 +42,7 @@ + (void)requestWithHTTPMethod:(HTTPMethod)method parameters:(NSDictionary *)parameters response:(void (^)(RCDHTTPResult *))responseBlock { AFHTTPSessionManager *manager = [RCDHTTPUtility sharedHTTPManager]; + URLString = [URLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *url = [BASE_URL stringByAppendingPathComponent:URLString]; switch (method) { diff --git a/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/Info.plist b/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/Info.plist index 1cd06d15..c6b1ebd0 100644 Binary files a/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/Info.plist and b/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/Info.plist differ diff --git a/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/RongContactCard b/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/RongContactCard index 892d22e5..9d182da4 100644 Binary files a/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/RongContactCard and b/ios-sealtalk/framework/RongContactCard/RongContactCard.framework/RongContactCard differ diff --git "a/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" "b/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" index 18cdd846..2419a027 100644 --- "a/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" +++ "b/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit App/Info.plist" @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.0.1 Dev + 4.0.2 Dev CFBundleSignature ???? CFBundleVersion - 202007201755 + 202008191835 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git "a/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" "b/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" index 9c03f6d6..6a738a72 100644 --- "a/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" +++ "b/ios-sealtalk/\350\236\215\344\272\221 Demo WatchKit Extension/Info.plist" @@ -17,11 +17,11 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 4.0.1 Dev + 4.0.2 Dev CFBundleSignature ???? CFBundleVersion - 202007201755 + 202008191835 NSExtension NSExtensionAttributes