11import 'dart:async' ;
22import 'dart:convert' ;
3- import 'dart:io' ;
43
54import 'package:collection/collection.dart' ;
65import 'package:flutter/foundation.dart' ;
@@ -201,7 +200,7 @@ class ExplorerService implements IExplorerService {
201200 _core.projectId,
202201 _referer,
203202 );
204- final uri = Platform .isIOS
203+ final uri = platformUtils.instance. getPlatformExact () == PlatformExact .iOS
205204 ? Uri .parse ('${UrlConstants .apiService }/getIosData' )
206205 : Uri .parse ('${UrlConstants .apiService }/getAndroidData' );
207206 try {
@@ -211,7 +210,12 @@ class ExplorerService implements IExplorerService {
211210 jsonDecode (response.body),
212211 (json) => NativeAppData .fromJson (json),
213212 );
214- return apiResponse.data.toList ();
213+ final result = apiResponse.data.toList ();
214+ loggerService.instance.d (
215+ '[$runtimeType ] fetched native data : ${result .map ((appData ) => jsonEncode (appData .toJson ()))}' ,
216+ error: response.statusCode,
217+ );
218+ return result;
215219 } else {
216220 loggerService.instance.d (
217221 '⛔ [$runtimeType ] error fetching native data $uri ' ,
@@ -423,6 +427,9 @@ class ExplorerService implements IExplorerService {
423427
424428 @override
425429 Future <W3MWalletInfo ?> getCoinbaseWalletObject () async {
430+ if (platformUtils.instance.getPlatformType () == PlatformType .web) {
431+ return null ;
432+ }
426433 final results = await _fetchListings (
427434 params: RequestParams (
428435 page: 1 ,
@@ -486,15 +493,17 @@ class ExplorerService implements IExplorerService {
486493
487494 String _getPlatformType () {
488495 final type = platformUtils.instance.getPlatformType ();
496+ final exactPlatform = platformUtils.instance.getPlatformExact ();
489497 final platform = type.toString ().toLowerCase ();
490498 switch (type) {
491499 case PlatformType .mobile:
492- if (Platform .isIOS) {
493- return 'ios' ;
494- } else if (Platform .isAndroid) {
495- return 'android' ;
496- } else {
497- return 'mobile' ;
500+ switch (exactPlatform) {
501+ case PlatformExact .iOS:
502+ return 'ios' ;
503+ case PlatformExact .android:
504+ return 'android' ;
505+ default :
506+ return 'mobile' ;
498507 }
499508 default :
500509 return platform;
0 commit comments