initializeWithToken static method
Initializes the HyperSnap SDK with an access token inside the client's application.
Parameters:
appId
: The application ID provided by HyperVerge.co.accessToken
: The access token provided by HyperVerge.co.region
: The region in which the SDK should be initialized. (e.g., Region.india)
Returns a Future that completes with a String value of "initialized" if the initialization is successful.
Implementation
static Future<String> initializeWithToken(
String appId, String accessToken, Region region) async {
String result = "Not Initialized";
try {
result = await _hyperSnapSDKChannel
.invokeMethod(HyperSnapSDKConstants.initializeWithToken, {
HyperSnapSDKConstants.appId: appId,
HyperSnapSDKConstants.accessToken: accessToken,
HyperSnapSDKConstants.region: region.regionName,
});
} catch (e) {
log(e.toString());
}
return result;
}