NIMSDKConfig Class Reference
Inherits from | NSObject |
---|---|
Declared in | NIMSDKConfig.h |
+ sharedConfig
Configuration instance
+ (instancetype)sharedConfig
Return Value
configuration option
Discussion
Configuration instance
Declared In
NIMSDKConfig.h
disableTraceroute
Disable NIMSDK tracroute capability
@property (nonatomic, assign) BOOL disableTraceroute
Discussion
Disable NIMSDK tracroute capability
The default value is NO. When the request fails, the SDK will perform traceroute to detect each node in the network to determine which node loses the connection.
Declared In
NIMSDKConfig.h
fetchAttachmentAutomaticallyAfterReceiving
Specify whether to automatically download attachments after receiving a message (group and P2P messages)
@property (nonatomic, assign) BOOL fetchAttachmentAutomaticallyAfterReceiving
Discussion
Specify whether to automatically download attachments after receiving a message (group and P2P messages)
The default value is YES. The SDK will directly download the message attachment when it receives a message for the first time, and the upper layer can set the value based on the business requirements
Declared In
NIMSDKConfig.h
fetchAttachmentAutomaticallyAfterReceivingInChatroom
Specify whether to automatically download attachments after receiving a message.
@property (nonatomic, assign) BOOL fetchAttachmentAutomaticallyAfterReceivingInChatroom
Discussion
Specify whether to automatically download attachments after receiving a message.
The default value is NO
Declared In
NIMSDKConfig.h
fileProtectionNone
Specify whether to use NSFileProtectionNone as NSProtectionKey
@property (nonatomic, assign) BOOL fileProtectionNone
Discussion
Specify whether to use NSFileProtectionNone as NSProtectionKey
The default value is NO. The setting takes effect only if Data Protection is enabled in the upper layer of the application
Declared In
NIMSDKConfig.h
shouldConsiderRevokedMessageUnreadCount
Specify whether to count recalled messages as unread
@property (nonatomic, assign) BOOL shouldConsiderRevokedMessageUnreadCount
Discussion
Specify whether to count recalled messages as unread
The default value is NO. If the value is set to YES, and the recalled message has not been read locally, then the unread count of the corresponding session will be decremented by 1 to maintain the consistency of the most recent session unread count. The reason for the default unread NO is that the client often needs to directly write a tip message to display the alert. Set to NO as the default value to directly write a read tip message to avoid the unread count from changing twice, which will eventually lead to the interface repeated refresh If the client does not need to write tip messages, the value can be set to YES to keep the unread count consistent.
Declared In
NIMSDKConfig.h
shouldSyncUnreadCount
Specify whether to sync the unread count on multiple devices @ discussion The default value is NO. If the value is set to YES, multiple devices (PC and mobile) of the same account will get synced with the unread count.
@property (nonatomic, assign) BOOL shouldSyncUnreadCount
Discussion
Specify whether to sync the unread count on multiple devices @ discussion The default value is NO. If the value is set to YES, multiple devices (PC and mobile) of the same account will get synced with the unread count.
Declared In
NIMSDKConfig.h
shouldCountTeamNotification
Specify whether to count group notifications as unread @ discussion The default value is NO. If the value is set to YES, group notifications received will also be counted as unread
@property (nonatomic, assign) BOOL shouldCountTeamNotification
Discussion
Specify whether to count group notifications as unread @ discussion The default value is NO. If the value is set to YES, group notifications received will also be counted as unread
Declared In
NIMSDKConfig.h
enabledHttpsForInfo
Enable HTTPS support for user profiles @ discussion The default value is YES. By default, user avatars, group avatars, chat room user avatars are hosted on CommsEase. The SDK will automatically enable HTTPS support for the data. Ff you want to host all the data on your own server, you must set the value to NO to prevent the SDK from automatically converting HTTP URLs to HTTPS URLs.
@property (nonatomic, assign) BOOL enabledHttpsForInfo
Discussion
Enable HTTPS support for user profiles @ discussion The default value is YES. By default, user avatars, group avatars, chat room user avatars are hosted on CommsEase. The SDK will automatically enable HTTPS support for the data. Ff you want to host all the data on your own server, you must set the value to NO to prevent the SDK from automatically converting HTTP URLs to HTTPS URLs.
Declared In
NIMSDKConfig.h
enabledHttpsForMessage
Enable HTTPS support for message content @ discussion The default value is YES. By default, messages, including images, videos, audios are hosted on CommsEase. The SDK will automatically enable HTTPS support for the data. If you want to host all the data on your own server, you must set the value to NO to prevent the SDK from automatically converting HTTP URLs to HTTPS URLs. (strongly not recommended) Note that even if this property is set, the URL of messages sent by the iOS SDK is still using the HTTPS protocol, and this setting only affects the URL format conversion of received messages
@property (nonatomic, assign) BOOL enabledHttpsForMessage
Discussion
Enable HTTPS support for message content @ discussion The default value is YES. By default, messages, including images, videos, audios are hosted on CommsEase. The SDK will automatically enable HTTPS support for the data. If you want to host all the data on your own server, you must set the value to NO to prevent the SDK from automatically converting HTTP URLs to HTTPS URLs. (strongly not recommended) Note that even if this property is set, the URL of messages sent by the iOS SDK is still using the HTTPS protocol, and this setting only affects the URL format conversion of received messages
Declared In
NIMSDKConfig.h
maxAutoLoginRetryTimes
Automatic login retry count @ discussion The default value is 0. By default, automatic login will retry infinitely. If the value set to a number greater than 0, the automatic login will retry up to maxAutoLoginRetryTimes times before no successful login. If retries fail, an error (NIMLocalErrorCodeAutoLoginRetryLimit) will be thrown.
@property (nonatomic, assign) NSInteger maxAutoLoginRetryTimes
Discussion
Automatic login retry count @ discussion The default value is 0. By default, automatic login will retry infinitely. If the value set to a number greater than 0, the automatic login will retry up to maxAutoLoginRetryTimes times before no successful login. If retries fail, an error (NIMLocalErrorCodeAutoLoginRetryLimit) will be thrown.
Declared In
NIMSDKConfig.h
maximumLogDays
Local log time to live @ discussion The default value is 7 days. Logs stored more than 7 days will be cleared. Only values greater than or equal to 2 can be set.
@property (nonatomic, assign) NSInteger maximumLogDays
Discussion
Local log time to live @ discussion The default value is 7 days. Logs stored more than 7 days will be cleared. Only values greater than or equal to 2 can be set.
Declared In
NIMSDKConfig.h
animatedImageThumbnailEnabled
Specify whether to support animated thumbnails. @ discussion The default value is NO. By default, if the original image thumbnail is obtained from the server and the original image is an animated image, the thumbnail of the first frame of the original image will be returned. If the option is enabled, animated images following the thumbnail will be returned. The option only affects thumbnails fetched from the server, not locally generated thumbnails.
@property (nonatomic, assign) BOOL animatedImageThumbnailEnabled
Discussion
Specify whether to support animated thumbnails. @ discussion The default value is NO. By default, if the original image thumbnail is obtained from the server and the original image is an animated image, the thumbnail of the first frame of the original image will be returned. If the option is enabled, animated images following the thumbnail will be returned. The option only affects thumbnails fetched from the server, not locally generated thumbnails.
Declared In
NIMSDKConfig.h
reconnectInBackgroundStateDisabled
Specify whether to prevent background reconnection @ discussion The default value is NO. By default, if the application is switched to the background and gets disconnected and is still running, the SDK will continue to execute the automatic reconnection mechanism. If the value is set to YES, the app will not automatically reconnect in the background, and the reconnection will be postponed to the foreground. This setting is only required for special scenarios. Proceed with caution.
@property (nonatomic, assign) BOOL reconnectInBackgroundStateDisabled
Discussion
Specify whether to prevent background reconnection @ discussion The default value is NO. By default, if the application is switched to the background and gets disconnected and is still running, the SDK will continue to execute the automatic reconnection mechanism. If the value is set to YES, the app will not automatically reconnect in the background, and the reconnection will be postponed to the foreground. This setting is only required for special scenarios. Proceed with caution.
Declared In
NIMSDKConfig.h
teamReceiptEnabled
Enable or disable read receipt of group messages @ discussion The default value is NO.
@property (nonatomic, assign) BOOL teamReceiptEnabled
Discussion
Enable or disable read receipt of group messages @ discussion The default value is NO.
Declared In
NIMSDKConfig.h
delegate
Configuration delegate
@property (nullable, nonatomic, weak) id<NIMSDKConfigDelegate> delegate
Discussion
Configuration delegate
Declared In
NIMSDKConfig.h
customTag
Client custom info synced on multiple devices
@property (nonatomic, copy) NSString *customTag
Discussion
Client custom info synced on multiple devices
Declared In
NIMSDKConfig.h
fileQuickTransferEnabled
Enable or disable file quick transfer. The default value is YES
@property (nonatomic, assign) BOOL fileQuickTransferEnabled
Discussion
Enable or disable file quick transfer. The default value is YES
Declared In
NIMSDKConfig.h
exceptionOptimizationEnabled
Enable or disable exception reporting. The default value is NO. Exception reporting is disabled
@property (nonatomic, assign) BOOL exceptionOptimizationEnabled
Discussion
Enable or disable exception reporting. The default value is NO. Exception reporting is disabled
Users can enable this option, which is convenient for CommsEase to analyze errors occurred in the SDK and optimize the SDK
Declared In
NIMSDKConfig.h
asyncLoadRecentSessionEnabled
Enable or disable asynchronously loading recent sessions. The default value is NO. Asynchronously loading recent sessions is disabled.
@property (nonatomic, assign) BOOL asyncLoadRecentSessionEnabled
Discussion
Enable or disable asynchronously loading recent sessions. The default value is NO. Asynchronously loading recent sessions is disabled.
For users with multiple recent sessions, the startup speed may be affected in retrieving data from the database. Users can enable this option to enable asynchronous loading recent sessions. allRecentSessions will return some recent sessions, and notify the user to refresh the UI using a callback when all sessions are loaded.
Declared In
NIMSDKConfig.h
sessionDatabaseBackupEnabled
Enable or disable database backup. The default value is NO. Database backup is disabled.
@property (nonatomic, assign) BOOL sessionDatabaseBackupEnabled
Discussion
Enable or disable database backup. The default value is NO. Database backup is disabled.
If database backup is enabled and the database file is corrupted, the SDK will restore the backup and reset the roaming timestamp
Declared In
NIMSDKConfig.h
maxUploadLogSize
The upper limit of the log size. The default value is 0, and no limit is applied. Unit: bytes
@property (nonatomic, assign) unsigned long long maxUploadLogSize
Discussion
The upper limit of the log size. The default value is 0, and no limit is applied. Unit: bytes
Declared In
NIMSDKConfig.h
shouldSyncStickTopSessionInfos
Specify whether to synchronize the top session records. The default value is NO
@property (nonatomic, assign) BOOL shouldSyncStickTopSessionInfos
Discussion
Specify whether to synchronize the top session records. The default value is NO
Declared In
NIMSDKConfig.h
customClientType
The client custom login type. The default value is 0, and a value greater than 0 is required.
@property (nonatomic, assign) NSInteger customClientType
Discussion
The client custom login type. The default value is 0, and a value greater than 0 is required.
Declared In
NIMSDKConfig.h
cdnTrackInterval
CDN statistics callback interval. Set the value before triggering CDN streaming, and the change will not take effect after the streaming starts. 0 indicates no statistics. The default value is 30 seconds.
@property (nonatomic, assign) NSTimeInterval cdnTrackInterval
Discussion
CDN statistics callback interval. Set the value before triggering CDN streaming, and the change will not take effect after the streaming starts. 0 indicates no statistics. The default value is 30 seconds.
Declared In
NIMSDKConfig.h
chatroomMessageReceiveMinInterval
The minimum time interval for receiving callbacks of chat room messages. If unspecified, the default value is used @discusssion The valid range adopted by the SDK: 50ms to 500ms. If a value is lower or higher than the boundary value, the boundary value is used.
@property (nonatomic, assign) NSTimeInterval chatroomMessageReceiveMinInterval
Discussion
The minimum time interval for receiving callbacks of chat room messages. If unspecified, the default value is used @discusssion The valid range adopted by the SDK: 50ms to 500ms. If a value is lower or higher than the boundary value, the boundary value is used.
Declared In
NIMSDKConfig.h
– setupSDKDir:
Set the SDK root directory
- (void)setupSDKDir:(NSString *)sdkDir
Parameters
sdkDir |
SDK root directory |
---|
Discussion
Set the SDK root directory
The data generated by the SDK (including chat records, but temporary files excluded) will be stored in this directory. If unspecified, all data will reside in the $Document/NIMSDK directory This configuration option must be set before any sharedSDK method in NIMSDK. Otherwise, the configuration will not take effect
Declared In
NIMSDKConfig.h
msgIndexProducer
Delegate to generate message indexs
@property (nullable, nonatomic) id<NIMMsgIndexProduceDelegate> msgIndexProducer
Discussion
Delegate to generate message indexs
Declared In
NIMSDKConfig.h