Monitor Database Upgrade Status
Starting from version 5.10.4, the SDK provides the RCDatabaseStatusDelegate
protocol to monitor changes in the database upgrade status.
When calling the SDK connection interface, a database upgrade operation may be triggered. If the data volume is large, this process can be time-consuming. By monitoring the database upgrade status, the app can handle different business logic or provide prompts on the page.
Database Upgrade Status Delegate Protocol
The RCDatabaseStatusDelegate
protocol is as follows:
@protocol RCDatabaseStatusDelegate <NSObject>
/*!
Database upgrade will start
- Since: 5.10.4
*/
- (void)databaseUpgradeWillStart;
/*!
Database upgrade completed
- Since: 5.10.4
*/
- (void)databaseUpgradeDidComplete:(RCErrorCode)code;
/*!
Database upgrade in progress
- Parameter progress: Upgrade progress 【0-100】
- Since: 5.10.4
*/
- (void)databaseIsUpgrading:(int)progress;
@end
Add or Remove Delegate
Set the database status listener, which supports multiple listeners.
To avoid memory leaks, remove the delegate when it is no longer needed.
// Add delegate
[[RCCoreClient sharedCoreClient] addDatabaseStatusDelegate:self];
// Remove delegate
[[RCCoreClient sharedCoreClient] removeDatabaseStatusDelegate:self];