openStrikeApp method

Future<void> openStrikeApp({
  1. String? invoiceId,
})

Launches the platform-specific app store to the Strike app

Implementation

Future<void> openStrikeApp({String? invoiceId}) async {
  String intent = kIsWeb ? 'lightning:$lnInvoice' : 'strike:lightning:$lnInvoice';

  launchUrl(
    Uri.parse(intent),
    webOnlyWindowName: kIsWeb ? '_blank' : null,
    mode: LaunchMode.externalNonBrowserApplication
  ).onError(
    (error, stackTrace) {
      debugPrint('error: ' + error.toString());
      Strike.openInAppStore();
      return true;
    },
  );
}