init static method

void init(
  1. String apiKey, [
  2. String userId = '',
  3. String endpoint = ''
])

Implementation

static void init(String apiKey, [String userId = '', String endpoint = '']) {
  try {
    setMessageChannel();
    if (endpoint.isNotEmpty) {
      plotlineChannel.invokeMethod('init', <String, dynamic>{
        'apiKey': apiKey,
        'userId': userId,
        'endpoint': endpoint
      });
    } else {
      plotlineChannel.invokeMethod('init', <String, dynamic>{
        'apiKey': apiKey,
        'userId': userId,
      });
    }
  } catch (e) {
    plotlineDebugLog("Error in init: $e");
  }
}