initialize abstract method

Future<void> initialize(
  1. RtcEngineContext context
)

Initializes RtcEngine.

All called methods provided by the RtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread. Before calling other APIs, you must call createAgoraRtcEngine and initialize to create and initialize the RtcEngine object. The SDK supports creating only one RtcEngine instance for an app.

  • context Configurations for the RtcEngine instance. See RtcEngineContext.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. < 0: Failure. -1: A general error occurs (no specified reason). -2: The parameter is invalid. -7: The SDK is not initialized. -22: The resource request failed. The SDK fails to allocate resources because your app consumes too much system resource or the system resources are insufficient. -101: The App ID is invalid.

Implementation

Future<void> initialize(RtcEngineContext context);