diff --git a/wallet/README.md b/wallet/README.md index 76871be19e..784552d8e6 100644 --- a/wallet/README.md +++ b/wallet/README.md @@ -6,6 +6,10 @@ Pylons Wallet This project is a starting point for a Flutter application. +1) Req .prod_env file and place it in /wallet/env/ dir. +2) Req GoogleService-Info.plist file and place it in /wallet/ios/runner dir. +3) Req Google-services.json file and place it in /wallet/android/app dir. +4) Req to add generated simulator Debug token to be added in firebase console>ios debug. diff --git a/wallet/ios/Runner/AppDelegate.swift b/wallet/ios/Runner/AppDelegate.swift index 3877d8faf8..ce807f935c 100644 --- a/wallet/ios/Runner/AppDelegate.swift +++ b/wallet/ios/Runner/AppDelegate.swift @@ -9,9 +9,14 @@ import flutter_downloader _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - // Uncomment while using ios simulator -// let providerFactory = AppCheckDebugProviderFactory() -// AppCheck.setAppCheckProviderFactory(providerFactory) + // Uncomment while using ios simulator + + #if DEBUG + let providerFactory = AppCheckDebugProviderFactory() + AppCheck.setAppCheckProviderFactory(providerFactory) + FirebaseApp.configure() + #endif + // Register Flutter plugins GeneratedPluginRegistrant.register(with: self) FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins) return super.application(application, didFinishLaunchingWithOptions: launchOptions) diff --git a/wallet/lib/main_prod.dart b/wallet/lib/main_prod.dart index 73b46aab92..bc5c2d44ad 100644 --- a/wallet/lib/main_prod.dart +++ b/wallet/lib/main_prod.dart @@ -32,6 +32,8 @@ Future main() async { await FlutterDownloader.initialize(ignoreSsl: true); await EasyLocalization.ensureInitialized(); await Firebase.initializeApp(); + await FirebaseAppCheck.instance.activate( + appleProvider: AppleProvider.debug,); await FirebaseCrashlytics.instance .setCrashlyticsCollectionEnabled(!kDebugMode); @@ -96,7 +98,7 @@ Future initializeAppCheck() async { // This kDebugMode check gets a android debug token from FirebaseAppCheck which can then be added on the Firebase console // iOS debug token from FirebaseAppCheck automatically get without method channel when run on debug mode which can then be added on the Firebase console // So that the application can be allowed to access to Firebase AppCheck token in debug mode. - if (kDebugMode && Platform.isAndroid) { +if (kDebugMode && Platform.isAndroid) { try { const MethodChannel methodChannel = MethodChannel(kGetFirebaseAppCheckTokenMethodChannelKey);