setEnvironment method

  1. @override
Future<bool> setEnvironment(
  1. int environment
)
override

setEnvironment sets environment for serving offers. 'environment' must be either 0 or 1. 0 - live environment. Default is set to 'live environment'. 1 - test environment. Returns a bool indicating that if setEnvironment call is successful or not. In case of error it can also throw exceptions. ///

Implementation

@override
Future<bool> setEnvironment(int environment) async {
  try {
    final statusMessage = await methodChannel.invokeMethod(
      "setEnvironment",
      {"environment": environment},
    );
    return statusMessage;
  } on PlatformException catch (error) {
    log(error.message as String);
    rethrow;
  }
}