From adfebe69403dd8d0350f58b89652fea0ff49837c Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Thu, 26 Jan 2023 20:53:26 +0200 Subject: [PATCH] Temporarily fetch unstoppable domains only on mobile --- lib/entities/unstoppable_domain_address.dart | 21 +++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/entities/unstoppable_domain_address.dart b/lib/entities/unstoppable_domain_address.dart index ab94e31fb..531702d38 100644 --- a/lib/entities/unstoppable_domain_address.dart +++ b/lib/entities/unstoppable_domain_address.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/services.dart'; const channel = MethodChannel('com.cake_wallet/native_utils'); @@ -6,13 +8,18 @@ Future fetchUnstoppableDomainAddress(String domain, String ticker) async var address = ''; try { - address = await channel.invokeMethod( - 'getUnstoppableDomainAddress', - { - 'domain' : domain, - 'ticker' : ticker - } - ) ?? ''; + if (Platform.isAndroid || Platform.isIOS) { + address = await channel.invokeMethod( + 'getUnstoppableDomainAddress', + { + 'domain' : domain, + 'ticker' : ticker + } + ) ?? ''; + } else { + // TODO: Integrate with Unstoppable domains resolution API + return address; + } } catch (e) { print('Unstoppable domain error: ${e.toString()}'); address = '';