Skip to content

Commit

Permalink
Merge pull request #2441 from Pylons-tech/feature/upgrade-version
Browse files Browse the repository at this point in the history
fix a few issues that happen due to library upgrades
  • Loading branch information
MikeSofaer authored Jul 3, 2024
2 parents 45d8950 + a93f87f commit b8576a9
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 45 deletions.
2 changes: 1 addition & 1 deletion wallet/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
16 changes: 8 additions & 8 deletions wallet/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -435,7 +435,7 @@
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -574,7 +574,7 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GOOGLE_SERVICE_PATH = "";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -606,7 +606,7 @@
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -692,7 +692,7 @@
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/prod/GoogleService-Info.plist";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -776,7 +776,7 @@
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/prod/GoogleService-Info.plist";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -862,7 +862,7 @@
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/development/GoogleService-Info.plist";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -946,7 +946,7 @@
ENABLE_BITCODE = NO;
GOOGLE_SERVICE_PATH = "${SRCROOT}/Runner/Firebase/development/GoogleService-Info.plist";
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
19 changes: 13 additions & 6 deletions wallet/lib/main_prod.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import 'package:pylons_wallet/components/loading.dart';
import 'package:pylons_wallet/pylons_app.dart';
import 'package:pylons_wallet/utils/base_env.dart';
import 'package:pylons_wallet/utils/constants.dart';
import 'package:pylons_wallet/utils/dependency_injection/dependency_injection.dart' as di;
import 'package:pylons_wallet/utils/dependency_injection/dependency_injection.dart'
as di;
import 'package:pylons_wallet/utils/extension.dart';
import 'package:pylons_wallet/utils/types.dart';

Expand All @@ -31,7 +32,8 @@ Future<void> main() async {
await FlutterDownloader.initialize(ignoreSsl: true);
await EasyLocalization.ensureInitialized();
await Firebase.initializeApp();
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(!kDebugMode);
await FirebaseCrashlytics.instance
.setCrashlyticsCollectionEnabled(!kDebugMode);

PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
Expand All @@ -53,7 +55,8 @@ Future<void> main() async {
FirebaseAnalytics.instance.logEvent(name: event.getEventName());
},
onLogError: (exception, {bool fatal = false, StackTrace? stack}) {
FirebaseCrashlytics.instance.recordError(exception, stack, fatal: fatal);
FirebaseCrashlytics.instance
.recordError(exception, stack, fatal: fatal);
},
onLogMessage: logMessage,
);
Expand Down Expand Up @@ -86,14 +89,17 @@ Future<void> main() async {
}

Future<void> initializeAppCheck() async {
await FirebaseAppCheck.instance.activate(webRecaptchaSiteKey: 'recaptcha-v3-site-key');
await FirebaseAppCheck.instance.activate(
webProvider: ReCaptchaV3Provider('recaptcha-v3-site-key'),
);
// FirebaseAppCheck when enforced would block incoming requests from Android and iOS in debug mode.
// 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) {
try {
const MethodChannel methodChannel = MethodChannel(kGetFirebaseAppCheckTokenMethodChannelKey);
const MethodChannel methodChannel =
MethodChannel(kGetFirebaseAppCheckTokenMethodChannelKey);
await methodChannel.invokeMethod(kGetFirebaseAppCheckDebugTokenKey);
} catch (e) {
e.toString().show();
Expand All @@ -105,6 +111,7 @@ class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
..badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
}
}
11 changes: 8 additions & 3 deletions wallet/lib/pages/image_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import 'package:pylons_wallet/pages/detailed_asset_view/widgets/create_trade_bot
import 'package:pylons_wallet/services/repository/repository.dart';
import 'package:pylons_wallet/utils/constants.dart';

Future<File?> pickImageFromGallery(double maxHeight, double maxWidth, int imageQuality, BuildContext context) async {
final pickImageEither = await GetIt.I.get<Repository>().pickImageFromGallery(PickImageModel(maxHeight: maxHeight, maxWidth: maxWidth, imageQuality: imageQuality, imageSource: ImageSource.gallery));
Future<File?> pickImageFromGallery(double maxHeight, double maxWidth,
int imageQuality, BuildContext context) async {
final pickImageEither = await GetIt.I.get<Repository>().pickImageFromGallery(
PickImageModel(
maxHeight: maxHeight,
maxWidth: maxWidth,
imageQuality: imageQuality,
imageSource: ImageSource.gallery));

if (pickImageEither.isLeft()) {
// ignore: use_build_context_synchronously
Expand All @@ -36,7 +42,6 @@ Future<File?> pickImageFromGallery(double maxHeight, double maxWidth, int imageQ
Future<CroppedFile?> cropImage(String path) async {
return ImageCropper().cropImage(
sourcePath: path,
aspectRatioPresets: [CropAspectRatioPreset.square, CropAspectRatioPreset.ratio3x2, CropAspectRatioPreset.original, CropAspectRatioPreset.ratio4x3, CropAspectRatioPreset.ratio16x9],
uiSettings: [
AndroidUiSettings(
toolbarTitle: kStripeMerchantDisplayName,
Expand Down
26 changes: 17 additions & 9 deletions wallet/lib/pages/stripe_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ class _StripeScreenState extends State<StripeScreen> {

Future<bool> loadLoginLink() async {
final loading = Loading()..showLoading();
final account_response = await GetIt.I.get<StripeHandler>().handleStripeAccountLink();
final account_response =
await GetIt.I.get<StripeHandler>().handleStripeAccountLink();
loading.dismiss();
account_response.fold((fail) => {fail.message.show()}, (accountlink) {
_controller.loadUrl(urlRequest: URLRequest(url: Uri.parse(accountlink)));
_controller.loadUrl(
urlRequest: URLRequest(url: WebUri.uri(Uri.parse(accountlink))));
});

return true;
Expand All @@ -73,7 +75,8 @@ class _StripeScreenState extends State<StripeScreen> {
top: 40.h,
bottom: 0,
child: InAppWebView(
initialUrlRequest: URLRequest(url: Uri.parse(widget.url)),
initialUrlRequest:
URLRequest(url: WebUri.uri(Uri.parse(widget.url))),
onWebViewCreated: (InAppWebViewController webViewController) {
_controller = webViewController;
},
Expand All @@ -88,7 +91,8 @@ class _StripeScreenState extends State<StripeScreen> {
getAccountLinkAndRedirect();
return NavigationActionPolicy.CANCEL;
}
if (urlInString.contains(baseEnv.baseStripeCallbackRefreshUrl)) {
if (urlInString
.contains(baseEnv.baseStripeCallbackRefreshUrl)) {
getAccountLinkAndRedirect();
return NavigationActionPolicy.CANCEL;
}
Expand All @@ -103,9 +107,11 @@ class _StripeScreenState extends State<StripeScreen> {
}
return NavigationActionPolicy.ALLOW;
},
androidOnPermissionRequest:
(InAppWebViewController controller, String origin, List<String> resources) async {
return PermissionRequestResponse(resources: resources, action: PermissionRequestResponseAction.GRANT);
androidOnPermissionRequest: (InAppWebViewController controller,
String origin, List<String> resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT);
},
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
Expand Down Expand Up @@ -148,10 +154,12 @@ class _StripeScreenState extends State<StripeScreen> {
Future getAccountLinkAndRedirect() async {
final loading = Loading()..showLoading();

final account_response = await GetIt.I.get<StripeHandler>().handleStripeAccountLink();
final account_response =
await GetIt.I.get<StripeHandler>().handleStripeAccountLink();
loading.dismiss();
account_response.fold((fail) => {fail.message.show()}, (accountlink) {
_controller.loadUrl(urlRequest: URLRequest(url: Uri.parse(accountlink)));
_controller.loadUrl(
urlRequest: URLRequest(url: WebUri.uri(Uri.parse(accountlink))));
});
}
}
34 changes: 17 additions & 17 deletions wallet/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,41 @@ dependencies:
path: pkgs/pdf_viewer-master
alan:
path: pkgs/alan
audio_video_progress_bar: ^1.0.0
audio_video_progress_bar: ^2.0.3
auto_size_text: ^3.0.0
backdrop: ^0.9.0
bottom_drawer: ^0.0.3
cached_network_image:
cloud_firestore: ^4.3.0
cloud_firestore: ^5.0.2
cupertino_icons: ^1.0.3
dartz: ^0.10.1
decimal: ^2.3.0
detectable_text_field: ^2.0.3
detectable_text_field: ^3.0.2
dotted_border: ^2.0.0+2
easy_localization: ^3.0.1
equatable: ^2.0.5
expandable: ^5.0.1
firebase_analytics:
firebase_app_check: ^0.1.1+7
firebase_core: ^2.4.0
firebase_crashlytics: ^3.0.8
firebase_dynamic_links: ^5.0.10
firebase_messaging: ^14.2.0
firebase_remote_config: ^3.0.8
firebase_app_check: ^0.3.0+2
firebase_core: ^3.1.1
firebase_crashlytics: ^4.0.2
firebase_dynamic_links: ^6.0.2
firebase_messaging: ^15.0.2
firebase_remote_config: ^5.0.2
fixnum: ^1.0.0
floor: ^1.3.0
flutter:
sdk: flutter
flutter_dotenv: ^5.0.2
flutter_downloader: ^1.9.1
flutter_inappwebview: ^5.7.2+2
flutter_local_notifications: ^13.0.0
flutter_inappwebview: ^6.0.0
flutter_local_notifications: ^17.2.1
flutter_localizations:
sdk: flutter
flutter_mobx: ^2.0.1
flutter_screenutil: ^5.5.4
flutter_secure_storage: ^8.0.0
flutter_staggered_grid_view: ^0.6.2
flutter_staggered_grid_view: ^0.7.0
flutter_sticky_header: ^0.6.0
flutter_stripe:
flutter_svg:
Expand All @@ -56,26 +56,26 @@ dependencies:
focus_detector: ^2.0.1
get_it: ^7.2.0
google_sign_in: ^6.0.2
googleapis: ^11.1.0
googleapis: ^13.2.0
grpc: ^3.0.2
home_widget: ^0.2.0+1
home_widget: ^0.6.0
http:
icloud_storage: ^2.0.0
image: ^4.0.12
image_cropper:
image_picker: ^0.8.5+3
image_picker: ^1.1.2
in_app_purchase: ^3.0.7
internet_connection_checker: ^1.0.0+1
intl:
just_audio: ^0.9.29
just_the_tooltip: 0.0.12
local_auth: ^2.1.2
mobx: ^2.0.3
modal_bottom_sheet: ^2.0.0
modal_bottom_sheet: ^3.0.0
model_viewer_plus:
path: pkgs/model_viewer_plus.dart-master
path_provider: ^2.0.11
permission_handler: ^10.0.1
permission_handler: ^11.3.1
provider: ^6.0.3
qr_flutter: ^4.0.0

Expand Down

0 comments on commit b8576a9

Please sign in to comment.