Skip to content

Commit

Permalink
Merge pull request #539 from zapcannon87/master
Browse files Browse the repository at this point in the history
Release v11.4.8
  • Loading branch information
zapcannon87 authored Dec 19, 2018
2 parents acb7e1b + f2d90a4 commit 7392547
Show file tree
Hide file tree
Showing 12 changed files with 383 additions and 495 deletions.
31 changes: 13 additions & 18 deletions AVOS/AVOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,8 @@
D37A046A1FF3705500AD44A9 /* testFile.md in Resources */ = {isa = PBXBuildFile; fileRef = D37A04691FF3705500AD44A9 /* testFile.md */; };
D3939CC720FEE621001C9F5C /* AVIMClientInternalConversationManager_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = D3939CC620FEE621001C9F5C /* AVIMClientInternalConversationManager_Internal.h */; };
D3939CC820FEE621001C9F5C /* AVIMClientInternalConversationManager_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = D3939CC620FEE621001C9F5C /* AVIMClientInternalConversationManager_Internal.h */; };
D3A3028921C9EC5300A6C09D /* IMTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3A3028821C9EC5300A6C09D /* IMTestViewController.swift */; };
D3A3028B21C9EC6600A6C09D /* LiveQueryTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3A3028A21C9EC6600A6C09D /* LiveQueryTestViewController.swift */; };
D3C53FCC2106D84A00D48686 /* AVIMClientProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D3C53FCB2106D84A00D48686 /* AVIMClientProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
D3C53FCD2106D84A00D48686 /* AVIMClientProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D3C53FCB2106D84A00D48686 /* AVIMClientProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
D3CC90CB2069E5BB0082EFD4 /* AVObjectTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CC90CA2069E5BB0082EFD4 /* AVObjectTestCase.swift */; };
Expand Down Expand Up @@ -1479,6 +1481,8 @@
D37A04661FF36E6200AD44A9 /* testVideo.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = testVideo.mp4; sourceTree = "<group>"; };
D37A04691FF3705500AD44A9 /* testFile.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = testFile.md; sourceTree = "<group>"; };
D3939CC620FEE621001C9F5C /* AVIMClientInternalConversationManager_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AVIMClientInternalConversationManager_Internal.h; sourceTree = "<group>"; };
D3A3028821C9EC5300A6C09D /* IMTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IMTestViewController.swift; sourceTree = "<group>"; };
D3A3028A21C9EC6600A6C09D /* LiveQueryTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveQueryTestViewController.swift; sourceTree = "<group>"; };
D3C53FCB2106D84A00D48686 /* AVIMClientProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AVIMClientProtocol.h; sourceTree = "<group>"; };
D3CC90CA2069E5BB0082EFD4 /* AVObjectTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AVObjectTestCase.swift; sourceTree = "<group>"; };
D3CDF4EA1FE8F3810033153E /* LCIMTestBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LCIMTestBase.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2335,6 +2339,8 @@
children = (
D3078A7B2010739700A4C5FD /* AppDelegate.swift */,
D3078A7D2010739700A4C5FD /* ViewController.swift */,
D3A3028821C9EC5300A6C09D /* IMTestViewController.swift */,
D3A3028A21C9EC6600A6C09D /* LiveQueryTestViewController.swift */,
D3078A7F2010739700A4C5FD /* Main.storyboard */,
D3078A822010739700A4C5FD /* Assets.xcassets */,
D3078A842010739700A4C5FD /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -3376,6 +3382,7 @@
};
D3078A782010739700A4C5FD = {
CreatedOnToolsVersion = 9.2;
DevelopmentTeam = G76VD4892G;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -4017,6 +4024,8 @@
files = (
D3078A7E2010739700A4C5FD /* ViewController.swift in Sources */,
D3078A7C2010739700A4C5FD /* AppDelegate.swift in Sources */,
D3A3028921C9EC5300A6C09D /* IMTestViewController.swift in Sources */,
D3A3028B21C9EC6600A6C09D /* LiveQueryTestViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -4131,7 +4140,6 @@
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.avoscloud.AVOSCloudIMOSX;
PRODUCT_NAME = AVOSCloudIM;
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -4192,7 +4200,6 @@
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.avoscloud.AVOSCloudIMOSX;
PRODUCT_NAME = AVOSCloudIM;
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -4263,7 +4270,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.AVOSCloud-macOS";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -4326,7 +4332,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.AVOSCloud-macOS";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -4390,7 +4395,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -4450,7 +4454,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -4892,7 +4895,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -4953,7 +4955,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -5007,7 +5008,6 @@
"-licucore",
"-ObjC",
);
PROVISIONING_PROFILE = "2a6f2f85-65c9-4344-b118-8977505bcf3b";
SDKROOT = iphoneos;
};
name = Debug;
Expand Down Expand Up @@ -5052,7 +5052,6 @@
"-licucore",
"-ObjC",
);
PROVISIONING_PROFILE = "2a6f2f85-65c9-4344-b118-8977505bcf3b";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
};
Expand Down Expand Up @@ -5116,7 +5115,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.AVOSCloud-iOS";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
Expand Down Expand Up @@ -5177,7 +5175,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.AVOSCloud-iOS";
PRODUCT_NAME = AVOSCloud;
PROVISIONING_PROFILE = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -5245,7 +5242,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "cn.leancloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_OBJC_BRIDGING_HEADER = "AVOSCloudTests/Swift/AVOSCloud-iOSTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -5306,7 +5302,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "cn.leancloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_OBJC_BRIDGING_HEADER = "AVOSCloudTests/Swift/AVOSCloud-iOSTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
Expand Down Expand Up @@ -5373,7 +5368,6 @@
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AVOSCloudIM;
PROVISIONING_PROFILE = "";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -5434,7 +5428,6 @@
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "com.avoscloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AVOSCloudIM;
PROVISIONING_PROFILE = "";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
Expand Down Expand Up @@ -5500,7 +5493,6 @@
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "cn.leancloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "AVOSCloudIMTests/Swift/AVOSCloudIM-iOSTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -5560,7 +5552,6 @@
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "cn.leancloud.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "AVOSCloudIMTests/Swift/AVOSCloudIM-iOSTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
Expand Down Expand Up @@ -5588,6 +5579,7 @@
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = G76VD4892G;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -5603,6 +5595,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = LeanCloud.RuntimeTestDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
Expand All @@ -5629,6 +5622,7 @@
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = G76VD4892G;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand All @@ -5639,6 +5633,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = LeanCloud.RuntimeTestDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
Expand Down
2 changes: 1 addition & 1 deletion AVOS/AVOSCloud/UserAgent.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define SDK_VERSION @"v11.4.7"
#define SDK_VERSION @"v11.4.8"
22 changes: 19 additions & 3 deletions AVOS/AVOSCloudIM/Client/AVIMClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ - (void)doInitializationWithClientId:(NSString *)clientId

- (void)dealloc
{
[self->_socketWrapper setActivatingReconnectionEnabled:false];
[self->_socketWrapper close];
}

Expand Down Expand Up @@ -414,6 +415,7 @@ - (void)openWithOption:(AVIMClientOpenOption)openOption
[client setSessionToken:sessionToken ttl:(sessionCommand.hasStTtl ? sessionCommand.stTtl : 0)];
[client->_pushManager uploadingDeviceToken];
[client->_pushManager addingClientIdToChannels];
[client->_socketWrapper setActivatingReconnectionEnabled:true];

[client invokeInUserInteractQueue:^{
callback(true, nil);
Expand Down Expand Up @@ -576,6 +578,7 @@ - (void)closeWithCallback:(void (^)(BOOL, NSError * _Nullable))callback
client->_status = AVIMClientStatusClosed;
[client clearSessionTokenAndTTL];
[client->_pushManager removingClientIdFromChannels];
[client->_socketWrapper setActivatingReconnectionEnabled:false];
[client->_socketWrapper close];

[client invokeInUserInteractQueue:^{
Expand Down Expand Up @@ -793,6 +796,8 @@ - (void)webSocketWrapper:(AVIMWebSocketWrapper *)socketWrapper didReceiveCommand
client->_status = AVIMClientStatusClosed;
[client clearSessionTokenAndTTL];
[client->_pushManager removingClientIdFromChannels];
[client->_socketWrapper setActivatingReconnectionEnabled:false];
[client->_socketWrapper close];
id <AVIMClientDelegate> delegate = client->_delegate;
SEL sel = @selector(client:didOfflineWithError:);
if (delegate && [delegate respondsToSelector:sel]) {
Expand Down Expand Up @@ -935,7 +940,10 @@ - (void)webSocketWrapperDidReopen:(AVIMWebSocketWrapper *)socketWrapper
[client invokeInUserInteractQueue:^{
if (error) {
AVLoggerError(AVLoggerDomainIM, @"session resuming failed with error: %@", error);
[delegate imClientPaused:client];
if ([error.domain isEqualToString:kLeanCloudErrorDomain] &&
error.code == AVIMErrorCodeCommandTimeout) {
[client webSocketWrapperDidReopen:socketWrapper];
}
} else {
[delegate imClientResumed:client];
}
Expand All @@ -947,7 +955,9 @@ - (void)webSocketWrapperDidReopen:(AVIMWebSocketWrapper *)socketWrapper
- (void)webSocketWrapperInReconnecting:(AVIMWebSocketWrapper *)socketWrapper
{
[self addOperationToInternalSerialQueue:^(AVIMClient *client) {
if (!client->_sessionToken) { return; }
if (!client->_sessionToken || client->_status == AVIMClientStatusResuming) {
return;
}
client->_status = AVIMClientStatusResuming;
[client invokeInUserInteractQueue:^{
[client->_delegate imClientResuming:client];
Expand All @@ -958,7 +968,9 @@ - (void)webSocketWrapperInReconnecting:(AVIMWebSocketWrapper *)socketWrapper
- (void)webSocketWrapperDidPause:(AVIMWebSocketWrapper *)socketWrapper
{
[self addOperationToInternalSerialQueue:^(AVIMClient *client) {
if (!client->_sessionToken) { return; }
if (!client->_sessionToken || client->_status == AVIMClientStatusPaused) {
return;
}
client->_status = AVIMClientStatusPaused;
[client invokeInUserInteractQueue:^{
[client->_delegate imClientPaused:client];
Expand All @@ -972,6 +984,8 @@ - (void)webSocketWrapper:(AVIMWebSocketWrapper *)socketWrapper didCloseWithError
if (!client->_sessionToken) { return; }
client->_status = AVIMClientStatusClosed;
[client clearSessionTokenAndTTL];
[client->_socketWrapper setActivatingReconnectionEnabled:false];
[client->_socketWrapper close];
id<AVIMClientDelegate> delegate = client->_delegate;
[client invokeInUserInteractQueue:^{
[delegate imClientClosed:client error:error];
Expand Down Expand Up @@ -1003,6 +1017,8 @@ - (void)process_session_closed:(AVIMGenericCommand *)inCommand

if (code == AVIMErrorCodeSessionConflict) {
[self->_pushManager removingClientIdFromChannels];
[self->_socketWrapper setActivatingReconnectionEnabled:false];
[self->_socketWrapper close];
id <AVIMClientDelegate> delegate = self->_delegate;
SEL sel = @selector(client:didOfflineWithError:);
if (delegate && [delegate respondsToSelector:sel]) {
Expand Down
1 change: 1 addition & 0 deletions AVOS/AVOSCloudIM/WebSocket/AVIMWebSocketWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
+ (void)setTimeoutIntervalInSeconds:(NSTimeInterval)seconds;
- (instancetype)initWithDelegate:(id<AVIMWebSocketWrapperDelegate>)delegate;
- (void)openWithCallback:(void (^)(BOOL succeeded, NSError *error))callback;
- (void)setActivatingReconnectionEnabled:(BOOL)enabled;
- (void)close;
- (void)sendCommandWrapper:(LCIMProtobufCommandWrapper *)commandWrapper;

Expand Down
Loading

0 comments on commit 7392547

Please sign in to comment.