File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Sources/EaseChatUIKit/Classes/Service/Client Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -52,20 +52,22 @@ public let cache_update_notification = "ChatUIKitContextUpdateCache"
5252 /// Returns the initialization success or an error that includes the description of the cause of the failure.
5353 @objc ( setupWithAppKey: option: )
5454 public func setup( appKey: String ? = nil , option: ChatOptions ? = nil ) -> ChatError ? {
55- if ChatUIKitClient . shared. option. option_UI. enableContact {
56- ChatClient . shared ( ) . contactManager? . add ( self , delegateQueue: nil )
57- }
55+ var error : ChatError ?
5856 if let options = option {
5957 options. uiKitVersion = ChatUIKit_VERSION
60- return ChatClient . shared ( ) . initializeSDK ( with: options)
58+ error = ChatClient . shared ( ) . initializeSDK ( with: options)
6159 } else {
6260 if let key = appKey {
6361 let options = ChatOptions ( appkey: key)
6462 options. uiKitVersion = ChatUIKit_VERSION
65- return ChatClient . shared ( ) . initializeSDK ( with: options)
63+ error = ChatClient . shared ( ) . initializeSDK ( with: options)
6664 }
67- return ChatError ( description: " App key can't be nil " , code: . invalidAppkey)
65+ error = ChatError ( description: " App key can't be nil " , code: . invalidAppkey)
66+ }
67+ if ChatUIKitClient . shared. option. option_UI. enableContact {
68+ ChatClient . shared ( ) . contactManager? . add ( self , delegateQueue: nil )
6869 }
70+ return error
6971 }
7072
7173 /// Login user.
You can’t perform that action at this time.
0 commit comments