WhiteSDK Class Reference

Inherits from NSObject
Declared in WhiteSDK.h

Overview

The WhiteSDK class.

Other Methods

+ version

The version of the current SDK in the string format. For example, "2.12.11".

+ (NSString *)version

Declared In

WhiteSDK.h

– initWithWhiteBoardView:config:commonCallbackDelegate:audioMixerBridgeDelegate:

Sets RTC audio mixing and event callbacks and initializes the WhiteSDK object.

- (instancetype)initWithWhiteBoardView:(WhiteBoardView *)boardView config:(WhiteSdkConfiguration *)config commonCallbackDelegate:(nullable id<WhiteCommonCallbackDelegate>)callback audioMixerBridgeDelegate:(nullable id<WhiteAudioMixerBridgeDelegate>)mixer

Parameters

boardView

The whiteboard view. See WhiteBoardView.

config

Configurations for the WhiteSdk object. See WhiteSdkConfiguration.

callback

Common event callbacks. See WhiteCommonCallbackDelegate.

mixer

Sets RTC audio mixing. See WhiteAudioMixerBridge. When you use the Agora RTC SDK and Interactive Whiteboard SDK at the same time, and the dynamic PPT displayed in the whiteboard contains audio files, you can call the AudioMixerBridge interface to play the audio in the dynamic PPT using the Agora RTC SDK interface.

Return Value

Initialized WhiteSDK object.

Discussion

Note:

Ensure that you call WhiteSdk to initialize a WhiteSdk object before calling any other APIs.

Declared In

WhiteSDK.h

– initWithWhiteBoardView:config:commonCallbackDelegate:

Initializes the WhiteSDK object.

- (instancetype)initWithWhiteBoardView:(WhiteBoardView *)boardView config:(WhiteSdkConfiguration *)config commonCallbackDelegate:(nullable id<WhiteCommonCallbackDelegate>)callback

Parameters

boardView

The whiteboard view. See WhiteBoardView.

config

Configurations for the WhiteSdk object. See WhiteSdkConfiguration.

callback

Common event callbacks. See WhiteCommonCallbackDelegate.

Discussion

Note:

Ensure that you call WhiteSdk to initialize a WhiteSdk object before calling any other APIs.

Declared In

WhiteSDK.h

– initWithWhiteBoardView:config:

- (instancetype)initWithWhiteBoardView:(WhiteBoardView *)boardView config:(WhiteSdkConfiguration *)config

Parameters

boardView

The whiteboard view. See WhiteBoardView.

config

Configurations for the WhiteSDK object. See WhiteSdkConfiguration.

Discussion

Initializes the WhiteSDK object.

Declared In

WhiteSDK.h

  audioMixer

Sets audio mixing.

@property (nonatomic, strong, readonly, nullable) WhiteAudioMixerBridge *audioMixer

Declared In

WhiteSDK.h

– setupFontFaces:

Declares the fonts that can be used in the local whiteboard.

- (void)setupFontFaces:(NSArray<WhiteFontFace*> *)fontFaces

Parameters

fontFaces

The specified fonts. See WhiteFontFace.

Availability

2.11.3

The fonts declared by this method can be used to render the characters in PPT and the characters entered by the text tool.

Both this method and loadFontFaces can declare the fonts to be used in the local whiteboard. The difference is that setupFontFaces has no callback to report whether the font declaration is successful; loadFontFaces triggers callbacks to report the preload result of each type of font.

Note:

  • This method works only for the local whiteboard and does not affect the font display of the remote whiteboard.
  • Fonts declared by this method will be downloaded only when they are used.
  • Font rendering may vary by device. For example, on some devices, the text will not be rendered until the font has finished loading, while on others, the text will be rendered first using the default font and then refreshed as a whole when the specified font has finished loading.
  • Each time this method is called, it overrides the original font declaration.
  • Do not call this method and the loadFontFaces method at the same time; otherwise, unexpected results may occur.

Declared In

WhiteSDK.h

– loadFontFaces:completionHandler:

Declares the fonts that can be used in the local whiteboard and preloads them.

- (void)loadFontFaces:(NSArray<WhiteFontFace*> *)fontFaces completionHandler:(void ( ^ ) ( BOOL success , WhiteFontFace *fontFace , NSError *_Nullable error ))completionHandler

Parameters

fontFaces

The specified fonts. See WhiteFontFace.

completionHandler

The call result:

Every time a font is loaded, a callback will be triggered to report whether the font has been loaded successfully. There will be as many callbacks as there are fonts in the incoming WhiteFontFace object.

Availability

2.11.3

The fonts declared by this method can be used to render the characters in PPT and the characters entered by the text tool.

Both this method and setupFontFaces can declare the fonts to be used in the local whiteboard. The difference is that setupFontFaces has no callback to report whether the font declaration is successful; loadFontFaces triggers callbacks to report the preload result of each type of fonts.

Note:

  • This method works only for the local whiteboard and does not affect the font display of the remote whiteboard.
  • Fonts declared by this method will be downloaded only when they are used.
  • Font rendering may vary by device. For example, on some devices, the text will not be rendered until the font has finished loading, while on others, the text will be rendered first using the default font and then refreshed as a whole when the specified font has finished loading.
  • Fonts declared and preloaded by this method cannot be deleted. Each method call adds the new fonts to the already preloaded fonts.
  • Do not call this method and the setupFontFaces method at the same time; otherwise, unexpected results may occur.

Declared In

WhiteSDK.h

– updateTextFont:

Sets the fonts used by the text tool in the local whiteboard.

- (void)updateTextFont:(NSArray<NSString*> *)fonts

Parameters

fonts

Names of the fonts. If the specified font does not exist in the user’s system, the text tool cannot use the font. Ensure you call setupFontFaces or loadFontFaces to preload the specified font into the local whiteboard.

Availability

2.11.3

Note:

  • This method only works for the local whiteboard and does not affect the font display of the remote whiteboard.
  • This method cannot set the fonts for rendering the characters in PPT.

Declared In

WhiteSDK.h

– getSlideVolumeWithCompletionHandler:

Gets the volume of the PPT slide.

- (void)getSlideVolumeWithCompletionHandler:(void ( ^ ) ( CGFloat volume , NSError *error ))completionHandler

Parameters

completionHandler

The result of the method call, including two fields, volume and error: - A successful call: volume ranges from (0,1], indicating the volume of the PPT; error returns nil. - A failed call: volume returns 0; error returns the error message.

Declared In

WhiteSDK.h

– updateSlideVolume:

更新当前 PPT 的音量。

- (void)updateSlideVolume:(CGFloat)volume

Parameters

volume

音量值,取值范围为 (0,1]。

Declared In

WhiteSDK.h

– setCommonCallbackDelegate:

Sets common event callbacks.

- (void)setCommonCallbackDelegate:(nullable id<WhiteCommonCallbackDelegate>)callbackDelegate

Parameters

callbackDelegate

Common event callbacks. See WhiteCommonCallbackDelegate.

Discussion

The SDK uses the WhiteCommonCallbackDelegate class to report SDK runtime events to the application.

Declared In

WhiteSDK.h

– setSlideDelegate:

Sets PPT callback events. The SDK processes PPT-related callbacks via WhiteSlideDelegate.

- (void)setSlideDelegate:(nullable id<WhiteSlideDelegate>)slideDelegate

Parameters

slideDelegate

PPT callback events,See WhiteSlideDelegate.

Declared In

WhiteSDK.h

– requestSlideLogToFilePath:result:

Writes the slide log into a specified file.

- (void)requestSlideLogToFilePath:(NSString *)path result:(void ( ^ ) ( BOOL success , NSError *error ))result

Parameters

path

The path to the specified file. If the file does not exist, it is created. If the file already exists, the slide log is appended to the end of the file.

result

The writing result of the log.

Declared In

WhiteSDK.h

Room Methods

– joinRoomWithConfig:callbacks:completionHandler:

Sets the configurations and event callbacks of whiteboard room and joins the live interactive whiteboard room.

- (void)joinRoomWithConfig:(WhiteRoomConfig *)config callbacks:(nullable id<WhiteRoomCallbackDelegate>)callbacks completionHandler:(void ( ^ ) ( BOOL success , WhiteRoom *_Nullable room , NSError *_Nullable error ))completionHandler

Parameters

config

Configurations for the WhiteRoom object. See WhiteRoomConfig.

callbacks

Sets room event callbacks. See WhiteRoomCallbackDelegate.

completionHandler

The call result:

  • The WhiteRoom object, if the method call succeeds. See WhiteRoom.
  • An error message, if the method call fails.

Declared In

WhiteSDK+Room.h