startSDK method

  1. @override
Future<void> startSDK(
  1. String token
)
override

Starts the Grouplink SDK with the provided token. This method initializes the SDK on both Android and iOS platforms. It uses platform-specific method channels to invoke the native SDK methods.

Implementation

@override
Future<void> startSDK(String token) async {
  if (Platform.isIOS) {
    try {
      iOSSDKChannel.invokeMethod(
        "startSDK",
        {"token": token},
      );
    } on PlatformException catch (e) {
      log("Error registerGrouplink: ${e.message}");
      rethrow;
    }
  }
  if (Platform.isAndroid) {
    try {
      methodChannel.invokeMethod(
        "registerGrouplink",
        {"token": token},
      );
    } on PlatformException catch (e) {
      log("Error registerGrouplink: ${e.message}");
      rethrow;
    }
  }
}