create method Null safety

Future<RtcEngine> create(
  1. String appId
)

Creates an RtcEngine instance.

Unless otherwise specified, all the methods provided by the RtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.

Note

Parameter appId The App ID issued to you by Agora. See How to get the App ID. Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only one RtcEngine instance. To change your App ID, call destroy to destroy the current RtcEngine instance, and after destroy returns 0, call create to create an RtcEngine instance with the new App ID.

Returns

  • An RtcEngine instance if the method call succeeds.
  • The error code, if this method call fails:

Implementation

static Future<RtcEngine> create(String appId) {
  return createWithContext(RtcEngineContext(appId));
}