Temporarily fetch unstoppable domains only on mobile

This commit is contained in:
OmarHatem 2023-01-26 20:53:26 +02:00
parent 132033207e
commit adfebe6940

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/services.dart';
const channel = MethodChannel('com.cake_wallet/native_utils');
@ -6,6 +8,7 @@ Future<String> fetchUnstoppableDomainAddress(String domain, String ticker) async
var address = '';
try {
if (Platform.isAndroid || Platform.isIOS) {
address = await channel.invokeMethod<String>(
'getUnstoppableDomainAddress',
<String, String> {
@ -13,6 +16,10 @@ Future<String> fetchUnstoppableDomainAddress(String domain, String ticker) async
'ticker' : ticker
}
) ?? '';
} else {
// TODO: Integrate with Unstoppable domains resolution API
return address;
}
} catch (e) {
print('Unstoppable domain error: ${e.toString()}');
address = '';