SyncedStore Class Reference

  • iOS

更新时间

Whiteboard iOS SDK 2.16.147 公开接口。

@interface SyncedStore: NSObject

成员

delegate

@property (weak, nonatomic) id<SyncedStoreUpdateCallBackDelegate> delegate;
Text
数据变更回调

Declared in Displayer/SyncedStore.h

– connectSyncedStoreStorage:defaultValue:completionHandler:

- (void)connectSyncedStoreStorage:(NSString *)name defaultValue:(NSDictionary *)defaultValue completionHandler:(void (^) (NSDictionary * _Nullable dict, NSError * _Nullable error))completionHandler;
Text
创建一个 SyncedStore 连接
该功能用于白板同步多端自定义状态值,并且可回放
每一个 name 都代表一个独立的 store, 可以创建多个 store

 @param name 房间内唯一标识
 @param defaultValue 默认值
 @param completionHandler 回调,连接成功时返回store值,失败返回error

Declared in Displayer/SyncedStore.h

– getStorageState:completionHandler:

- (void)getStorageState:(NSString *)name completionHandler:(void (^) (NSDictionary * _Nullable dict))completionHandler;
Text
获取指定 Store 的当前状态
创建连接成功之后才可以调用本方法获取状态

 @param name 房间内唯一标志
 @param completionHandler 回调,最新状态

Declared in Displayer/SyncedStore.h

– disconnectStorage:

- (void)disconnectStorage:(NSString *)name;
Text
断开指定 Store 的连接,不会删除 Store 的数据

 @param name 房间内唯一标志

Declared in Displayer/SyncedStore.h

– deleteStorage:

- (void)deleteStorage:(NSString *)name;
Text
删除指定 Store 的数据并且断开连接

 @param name 房间内唯一标志

Declared in Displayer/SyncedStore.h

– resetState:

- (void)resetState:(NSString *)name;
Text
重置指定 Store 的数据到初始化状态

 @param name 房间内唯一标志

Declared in Displayer/SyncedStore.h

– setStorageState:partialState:

- (void)setStorageState:(NSString *)name partialState:(NSDictionary *)partialState;
Text
更新指定 Store 的部分数据

 @param name 房间内唯一标志
 @param partialState 需要更新的数据

Declared in Displayer/SyncedStore.h

这个页面有帮助吗?