logo
On this page

ZegoRangeScene

ZegoRangeScene

Declared in ZegoExpressDefines.h

Methods

getRangeSceneStream

getRangeSceneStream
- (ZegoRangeSceneStream *)getRangeSceneStream;
Get a range scene stream instance.
Declared in ZegoExpressDefines.h

Get a range scene stream instance. Use case: Often used in meta world scenarios, users can use related functions by getting range scene stream instance objects.

  • When to call: After creating the range scene via [createRangeScene], before destroying the range scene via [destroyRangeScene].
  • Available since: 3.0.0
  • Restrictions: None.

range scene stream instance.

getRangeSceneTeam

getRangeSceneTeam
- (ZegoRangeSceneTeam *)getRangeSceneTeam;
Get a range scene team instance.
Declared in ZegoExpressDefines.h

Get a range scene team instance. Use case: Often used in meta world scenarios, users can use related functions by getting range scene team instance objects.

  • When to call: After creating the range scene via [createRangeScene], before destroying the range scene via [destroyRangeScene].
  • Available since: 3.1.0
  • Restrictions: None.

range scene team instance.

getRangeSceneItem

getRangeSceneItem
- (ZegoRangeSceneItem *)getRangeSceneItem;
Get a range scene item instance.
Declared in ZegoExpressDefines.h

Get a range scene item instance. Use case: Often used in meta world scenarios, users can use related functions by getting range scene item instance objects.

  • When to call: After creating the range scene via [createRangeScene], before destroying the range scene via [destroyRangeScene].
  • Available since: 3.1.0
  • Restrictions: None.

range scene item instance.

getRangeSceneHandle

getRangeSceneHandle
- (int)getRangeSceneHandle;
Get range scene instance handle.
Declared in ZegoExpressDefines.h

Get range scene instance handle. Use case: Used to publish stream to the scene.

  • When to call: After creating the range scene via [createRangeScene], before destroying the range scene via [destroyRangeScene].
  • Available since: 3.0.0
  • Restrictions: None.

Range scene instance handle.

setEventHandler:

setEventHandler:
- (BOOL)setEventHandler:(nullable id<ZegoRangeSceneEventHandler>) handler;
set range scene event handler.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
handlernullable id<ZegoRangeSceneEventHandler>The object used to receive range scene callbacks.

Details

Set the callback function of the range scene module.

  • When to call: After creating the range scene via [createRangeScene], before destroying the range scene via [destroyRangeScene].
  • Available since: 3.0.0

Return

The result of set range scene event handler, true: success, false: fail.

loginScene:callback:

loginScene:callback:
- (int)loginScene:(ZegoSceneParam *) param callback:(nullable ZegoRangeSceneLoginSceneCallback) callback;
Logs in to a scene.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
paramZegoSceneParam *Scene param.
callbacknullable ZegoRangeSceneLoginSceneCallbackThe callback of login scene.

Details

SDK RangeScene uses the 'scene' to organize users.

  • Use cases: Users interact in the RangeScene within the same scene.
  • When to call: After creating the range scene via [createRangeScene], before destroying the range scene via [destroyRangeScene].
  • Caution: 1. Apps that use different appIDs cannot intercommunication with each other. 2. It is strongly recommended that userID corresponds to the user ID of the business APP, that is, a userID and a real user are fixed and unique, and should not be passed to the SDK in a random userID. Because the unique and fixed userID allows ZEGO technicians to quickly locate online problems.
  • Privacy reminder: Please do not fill in sensitive user information in this interface, including but not limited to mobile phone number, ID number, passport number, real name, etc.
  • Related callbacks: 1. When the user starts to log in to the scene, the scene is successfully logged in, or the scene fails to log in, the [onSceneStateUpdate] callback will be triggered to notify the developer of the status of the current user connected to the scene. 2. If the network is temporarily interrupted due to network quality reasons, the SDK will automatically reconnect internally. You can get the current connection status of the local scene by listening to the [onSceneStateUpdate] callback method.
  • Related APIs: 1. Users can call [logoutScene] to log out.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

logoutScene:

logoutScene:
- (int)logoutScene:(nullable ZegoRangeSceneLogoutSceneCallback) callback;
Logs out of a scene.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
callbacknullable ZegoRangeSceneLogoutSceneCallbackThe callback of logout scene.

Details

This API will log out the current user has logged in the scene.

  • When to call: After successfully logging in to the scene, if the scene is no longer used, the user can call the function [logoutScene].
  • Caution: Exiting a scene stops all publishing and playing stream associated with the scene for that user.
  • Related callbacks: After calling this function, you will receive [onSceneStateUpdate] callback notification successfully exits the scene.
  • Related APIs: Users can use [loginScene] functions to log in scene.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

updateUserStatus:channel:status:

updateUserStatus:channel:status:
- (int)updateUserStatus:(ZegoPosition *) position channel:(unsigned int) channel status:(NSData *) status;
Update user status.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
positionZegoPosition *User's current location.
channelunsigned intThe channel to which the status belongs, starting from 0, cannot exceed the maximum channel number.
statusNSData *Current status data.

Details

Developers can call this function to update the user status.

  • When to call: After [LoginScene], before [LogoutScene].
  • Caution: None.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

updateUserCommand:channel:command:

updateUserCommand:channel:command:
- (int)updateUserCommand:(ZegoPosition *) position channel:(unsigned int) channel command:(NSData *) command;
Update user status.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
positionZegoPosition *User's current location.
channelunsigned intThe channel to which the command belongs, starting from 0, cannot exceed the maximum channel number.
commandNSData *Next command data.

Details

Developers can call this function to update the user command.

  • When to call: After [LoginScene], before [LogoutScene].
  • Caution: None.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

updateUserPosition:

updateUserPosition:
- (int)updateUserPosition:(ZegoPosition *) position;
Update user position.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
positionZegoPosition *User's current location.

Details

Developers can call this function to update the user position.

  • When to call: After [LoginScene], before [LogoutScene].
  • Caution: None.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

getUserCount:

getUserCount:
- (int)getUserCount:(nullable ZegoRangeSceneGetUserCountCallback) callback;
Get user count in scene.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
callbacknullable ZegoRangeSceneGetUserCountCallbackThe callback of get user count in scene.

Details

Developers can call this function to get user count in scene.

  • When to call: After [LoginScene], before [LogoutScene].
  • Default value: nil.
  • Caution: None.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

getUserListInView:

getUserListInView:
- (int)getUserListInView:(nullable ZegoRangeSceneGetUserListInViewCallback) callback;
Get user list in view.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
callbacknullable ZegoRangeSceneGetUserListInViewCallbackThe callback of get user list in view.

Details

Developers can call this function to get user list in view.

  • When to call: After [LoginScene], before [LogoutScene].
  • Default value: nil.
  • Caution: None.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

sendCustomCommand:callback:

sendCustomCommand:callback:
- (int)sendCustomCommand:(NSData *) command callback:(nullable ZegoRangeSceneSendCustomCommandCallback) callback;
Send custom command.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
commandNSData *Custom command.
callbacknullable ZegoRangeSceneSendCustomCommandCallbackThe callback of send custom command.

Details

Developers can call this function to send custom command.

  • When to call: After [LoginScene], before [LogoutScene].
  • Default value: nil.
  • Caution: None.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

renewToken:

renewToken:
- (int)renewToken:(NSString *) token;
Renew token.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
tokenNSString *The token that needs to be renew.

Details

After the developer receives [onSceneTokenWillExpire], they can use this API to update the token to ensure that the subsequent RTC functions are normal.

  • Use cases: Used when the token is about to expire.
  • When to call /Trigger: After the developer receives [onSceneTokenWillExpire].
  • Available since: 3.1.0
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

setStreamConfig:

setStreamConfig:
- (int)setStreamConfig:(ZegoSceneStreamConfig *) config;
Set range scene stream config.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
configZegoSceneStreamConfig *Range scene stream config.

Details

Developers can call this function to set range scene stream config.

  • When to call: After [createRangeScene].
  • Default value: nil.
  • Caution: None.
  • Restrictions: None.

Return

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

Previous

zegorangeaudio

Next

zegorangesceneeventhandler

On this page

Back to top