shutdown method
Shutdown SDK shared instance.
Stops SDK services, sends the queued user data, and de-intialized the SDK.
After that is executed, the SDK State.uninitialized is triggered.
The force
parameter (default: true
) will discard pending data to be uploaded.
With force
= true shudown will always succseed.
Returns when shutdown completed or failed.
Implementation
@override
Future<MoveShutdownResult> shutdown({bool force = true}) async {
try {
await methodChannel.invokeMethod(
'shutdown',
<String, dynamic>{
'force': force,
},
);
} on PlatformException catch (e) {
switch (e.code) {
case "uninitialized":
return MoveShutdownResult.uninitialized;
case "networkError":
return MoveShutdownResult.networkError;
}
}
return MoveShutdownResult.success;
}