trackPurchase method

Future<void> trackPurchase(
  1. TrackPurchaseParameters parameters
)

Records the user purchase.

Implementation

Future<void> trackPurchase(TrackPurchaseParameters parameters) async {
  if (defaultTargetPlatform == TargetPlatform.iOS) {
    if (!FWGlobalState.getInstance().sdkInitCalled) {
      await FWGlobalState.getInstance().sdkInitCalledFuture;
    }
    final nativeMethodName = FireworkSDKNativeMethodName.trackPurchase.name;
    FWMethodChannelUtil.getFirewokSDKChannel().invokeMethod(
        nativeMethodName, TrackPurchaseParametersUtil.toJson(parameters));
  }
}