start static method

Future<ApphudUser> start({
  1. required String apiKey,
  2. String? userID,
  3. bool? observerMode,
})

Initializes Apphud SDK. You should call it during app launch.

  • parameter apiKey is required. Your api key.

  • parameter userID is optional. You can provide your own unique user identifier. If null passed then UUID will be generated instead.

  • parameter observerMode is optional, iOS only. Sets SDK to Observer (i.e. Analytics) mode. If you purchase products by other code, then pass true. If you purchase products using Apphud.purchase(..) method, then pass false. Default value is false.

  • Returns ApphudUser object after the SDK initialization is complete. Note: Do not store ApphudUser instance in your own code, since it may change at runtime.

Implementation

static Future<ApphudUser> start({
  required String apiKey,
  String? userID,
  bool? observerMode,
}) async {
  final json = await _channel.invokeMethod('start', {
    'apiKey': apiKey,
    'userID': userID,
    'observerMode': observerMode ?? false,
  });
  return ApphudUser.fromJson(json);
}