File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
// ignore_for_file: avoid_classes_with_only_static_members
2
2
3
3
import 'dart:async' ;
4
- import 'dart:io' show Platform;
5
4
6
5
import 'package:flutter/services.dart' ;
6
+ import 'package:instabug_flutter/utils/platform_manager.dart' ;
7
7
8
8
class Surveys {
9
9
static Function ? _onShowCallback;
@@ -131,7 +131,7 @@ class Surveys {
131
131
/// NPS Surveys or AppRating Surveys to AppStore to let users rate your app on AppStore itself.
132
132
/// [appStoreURL] A String url for the published iOS app on AppStore
133
133
static Future <void > setAppStoreURL (String appStoreURL) async {
134
- if (Platform . isIOS) {
134
+ if (PlatformManager .instance. isIOS () ) {
135
135
final List <dynamic > params = < dynamic > [appStoreURL];
136
136
await _channel.invokeMethod <Object >('setAppStoreURL:' , params);
137
137
}
Original file line number Diff line number Diff line change @@ -704,6 +704,21 @@ void main() {
704
704
]);
705
705
});
706
706
707
+ test ('setAppStoreURL Test' , () async {
708
+ const appStoreURL = 'appStoreURL' ;
709
+ final List <dynamic > args = < dynamic > [appStoreURL];
710
+
711
+ when (mockPlatform.isIOS ()).thenAnswer ((_) => true );
712
+
713
+ Surveys .setAppStoreURL (appStoreURL);
714
+ expect (log, < Matcher > [
715
+ isMethodCall (
716
+ 'setAppStoreURL:' ,
717
+ arguments: args,
718
+ )
719
+ ]);
720
+ });
721
+
707
722
test ('showFeatureRequests Test' , () async {
708
723
FeatureRequests .show ();
709
724
expect (
You can’t perform that action at this time.
0 commit comments