initialize method
Implementation
Future<bool> initialize(String apiToken) async {
_apiToken = apiToken;
App appData = await _createAppData();
Device deviceData = await _createDeviceData();
AppInstall response =
await Api.ping(PingRequest(apiToken: _apiToken!, app: appData, device: deviceData)).catchError((Object error) {
print('Ping to critic failed: ' + error.toString());
return Future<AppInstall>.error(false);
});
_appId = response.id;
return true;
}