From 94fb2e015b1b5c12fc4df229791d745cdb45823e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 5 Jul 2022 18:04:45 +0300 Subject: [PATCH 01/11] Update bitsdojo commented code --- lib/ui/app/app_title_bar.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ui/app/app_title_bar.dart b/lib/ui/app/app_title_bar.dart index 900503dd86f..0c3e610a209 100644 --- a/lib/ui/app/app_title_bar.dart +++ b/lib/ui/app/app_title_bar.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; -//import 'package:bitsdojo_window/bitsdojo_window.dart'; -//import 'package:flutter_redux/flutter_redux.dart'; -//import 'package:invoiceninja_flutter/redux/app/app_state.dart'; -//import 'package:invoiceninja_flutter/utils/platforms.dart'; -//import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; +/* +import 'package:bitsdojo_window/bitsdojo_window.dart'; +import 'package:flutter_redux/flutter_redux.dart'; +import 'package:invoiceninja_flutter/redux/app/app_state.dart'; +import 'package:invoiceninja_flutter/utils/platforms.dart'; +import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; +*/ class AppTitleBar extends StatelessWidget { const AppTitleBar({Key key}) : super(key: key); From 5aa004d193d4a4fe38a2ec7d11822b647aef11a3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 5 Jul 2022 18:08:01 +0300 Subject: [PATCH 02/11] Add options to settings search --- lib/ui/settings/settings_list.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ui/settings/settings_list.dart b/lib/ui/settings/settings_list.dart index 12b6b231bfa..e1d188b28e8 100644 --- a/lib/ui/settings/settings_list.dart +++ b/lib/ui/settings/settings_list.dart @@ -454,6 +454,8 @@ class SettingsSearch extends StatelessWidget { [ 'long_press_multiselect', 'biometric_authentication', + 'enable_flexible_search', + 'enable_tooltips', 'show_pdf_preview', 'refresh_data', ], From 5878976250fe1bf17eba70761ed8ba24d2aebc4f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 5 Jul 2022 18:15:37 +0300 Subject: [PATCH 03/11] Trim http/https from client/vendor website url --- lib/ui/client/view/client_view_fullwidth.dart | 4 +++- lib/ui/vendor/view/vendor_view_fullwidth.dart | 5 +++-- lib/utils/strings.dart | 10 ++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/ui/client/view/client_view_fullwidth.dart b/lib/ui/client/view/client_view_fullwidth.dart index c445fa6e982..cf989810f8f 100644 --- a/lib/ui/client/view/client_view_fullwidth.dart +++ b/lib/ui/client/view/client_view_fullwidth.dart @@ -15,6 +15,7 @@ import 'package:invoiceninja_flutter/ui/client/view/client_view_system_logs.dart import 'package:invoiceninja_flutter/ui/client/view/client_view_vm.dart'; import 'package:invoiceninja_flutter/utils/formatting.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; +import 'package:invoiceninja_flutter/utils/strings.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -121,7 +122,8 @@ class _ClientViewFullwidthState extends State child: CopyToClipboard( value: client.website, child: IconText( - icon: MdiIcons.earth, text: client.website), + icon: MdiIcons.earth, + text: trimUrl(client.website)), ), ), SizedBox(height: 4), diff --git a/lib/ui/vendor/view/vendor_view_fullwidth.dart b/lib/ui/vendor/view/vendor_view_fullwidth.dart index 7b21b97d05c..9422ebd1b1b 100644 --- a/lib/ui/vendor/view/vendor_view_fullwidth.dart +++ b/lib/ui/vendor/view/vendor_view_fullwidth.dart @@ -12,6 +12,7 @@ import 'package:invoiceninja_flutter/ui/app/screen_imports.dart'; import 'package:invoiceninja_flutter/ui/vendor/view/vendor_view_documents.dart'; import 'package:invoiceninja_flutter/utils/formatting.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; +import 'package:invoiceninja_flutter/utils/strings.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -113,8 +114,8 @@ class _VendorViewFullwidthState extends State padding: const EdgeInsets.symmetric(vertical: 4), child: CopyToClipboard( value: vendor.website, - child: - IconText(icon: MdiIcons.earth, text: vendor.website), + child: IconText( + icon: MdiIcons.earth, text: trimUrl(vendor.website)), ), ), SizedBox(height: 4), diff --git a/lib/utils/strings.dart b/lib/utils/strings.dart index f5183a15389..28259edac65 100644 --- a/lib/utils/strings.dart +++ b/lib/utils/strings.dart @@ -190,3 +190,13 @@ int secondToLastIndexOf(String string, String pattern) { return string.lastIndexOf(pattern); } + +String trimUrl(String url) { + url = url.replaceFirst('http://', '').replaceFirst('https://', ''); + + if (url.startsWith('www.')) { + url = url.replaceFirst('www.', ''); + } + + return url; +} From 3b1c902ed2eb3b25675291d8dcfe1a6e68ed1ddc Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 5 Jul 2022 18:21:20 +0300 Subject: [PATCH 04/11] Increase Flutter version for web build --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfc6a27e0b8..374a8ffc2eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v1 - uses: subosito/flutter-action@v1 with: - flutter-version: '3.0.0' + flutter-version: '3.0.4' #channel: 'stable' - name: Install Sentry run: | @@ -114,7 +114,7 @@ jobs: - uses: actions/checkout@v1 - uses: subosito/flutter-action@v1 with: - flutter-version: '3.0.0' + flutter-version: '3.0.4' #channel: 'stable' - name: Setup Flutter run: | From 46e3c3f682b0e5c0a86df402976b4fb111f9ece1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 5 Jul 2022 21:07:58 +0300 Subject: [PATCH 05/11] Fix for F-Droid #441 --- android/gradle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/android/gradle.properties b/android/gradle.properties index 9a334c62e25..8dcb4c354fe 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -3,3 +3,4 @@ android.useAndroidX=true android.enableJetifier=true android.enableR8=true android.enableDexingArtifactTransform=false +android.jetifier.blacklist=bcprov \ No newline at end of file From 4361e9aea5745ec19c5420a90de1799d3b23327c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 6 Jul 2022 09:05:17 +0300 Subject: [PATCH 06/11] Hide upgrade CTAs on Apple devices --- lib/ui/app/invoice/invoice_email_view.dart | 20 +++++++++++--------- lib/ui/reports/reports_screen.dart | 10 ++++++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/ui/app/invoice/invoice_email_view.dart b/lib/ui/app/invoice/invoice_email_view.dart index 372317d5c6f..8dbb79b7f42 100644 --- a/lib/ui/app/invoice/invoice_email_view.dart +++ b/lib/ui/app/invoice/invoice_email_view.dart @@ -299,15 +299,17 @@ class _InvoiceEmailViewState extends State padding: const EdgeInsets.only(bottom: 10), child: IconMessage( localization.customEmailsDisabledHelp, - trailing: TextButton( - child: Text( - localization.upgrade.toUpperCase(), - style: TextStyle( - color: Colors.white, - ), - ), - onPressed: () => launch(state.userCompany.ninjaPortalUrl), - ), + trailing: isApple() + ? null + : TextButton( + child: Text( + localization.upgrade.toUpperCase(), + style: TextStyle( + color: Colors.white, + ), + ), + onPressed: () => launch(state.userCompany.ninjaPortalUrl), + ), ), ), ColoredBox( diff --git a/lib/ui/reports/reports_screen.dart b/lib/ui/reports/reports_screen.dart index abdc9a371ca..c52adc53635 100644 --- a/lib/ui/reports/reports_screen.dart +++ b/lib/ui/reports/reports_screen.dart @@ -412,10 +412,12 @@ class ReportsScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ HelpText(localization.upgradeToViewReports), - AppButton( - label: localization.upgrade.toUpperCase(), - onPressed: () => launch(state.userCompany.ninjaPortalUrl), - ) + if (!isApple()) + AppButton( + label: localization.upgrade.toUpperCase(), + onPressed: () => + launch(state.userCompany.ninjaPortalUrl), + ) ], ), ) From 76cda3403254ae79a65164f8e13fec363b792429 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 6 Jul 2022 10:19:54 +0300 Subject: [PATCH 07/11] App review --- lib/ui/app/menu_drawer.dart | 8 ++------ lib/ui/app/review_app.dart | 14 ++++---------- lib/utils/review.dart | 13 +++++++++++++ lib/utils/review.dart.foss | 12 ++++++++++++ pubspec.foss.yaml | 2 +- pubspec.next.yaml | 2 +- pubspec.yaml | 2 +- 7 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 lib/utils/review.dart create mode 100644 lib/utils/review.dart.foss diff --git a/lib/ui/app/menu_drawer.dart b/lib/ui/app/menu_drawer.dart index fa93ec33fa6..30ad1ff0ab5 100644 --- a/lib/ui/app/menu_drawer.dart +++ b/lib/ui/app/menu_drawer.dart @@ -5,13 +5,13 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:in_app_review/in_app_review.dart'; // Package imports: import 'package:flutter_redux/flutter_redux.dart'; import 'package:flutter_styled_toast/flutter_styled_toast.dart'; import 'package:invoiceninja_flutter/redux/auth/auth_actions.dart'; import 'package:invoiceninja_flutter/redux/settings/settings_actions.dart'; +import 'package:invoiceninja_flutter/utils/review.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:pointer_interceptor/pointer_interceptor.dart'; import 'package:redux/redux.dart'; @@ -1379,11 +1379,7 @@ void _showAbout(BuildContext context) async { if (kIsWeb || isLinux()) { launch(getRateAppURL(context)); } else { - final InAppReview inAppReview = InAppReview.instance; - inAppReview.openStoreListing( - appStoreId: kAppStoreId, - microsoftStoreId: kMicrosoftAppStoreId, - ); + AppReview.openStoreListing(); } }, ), diff --git a/lib/ui/app/review_app.dart b/lib/ui/app/review_app.dart index 2185d825de7..3da7847c7b5 100644 --- a/lib/ui/app/review_app.dart +++ b/lib/ui/app/review_app.dart @@ -1,15 +1,14 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; -import 'package:invoiceninja_flutter/constants.dart'; import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; import 'package:invoiceninja_flutter/redux/app/app_state.dart'; import 'package:invoiceninja_flutter/ui/app/form_card.dart'; import 'package:invoiceninja_flutter/ui/app/menu_drawer.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:invoiceninja_flutter/utils/platforms.dart'; +import 'package:invoiceninja_flutter/utils/review.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:in_app_review/in_app_review.dart'; class ReviewApp extends StatefulWidget { const ReviewApp({Key key}) : super(key: key); @@ -21,8 +20,6 @@ class ReviewApp extends StatefulWidget { class _ReviewAppState extends State { bool _likesTheApp; - final InAppReview inAppReview = InAppReview.instance; - @override Widget build(BuildContext context) { final localization = AppLocalization.of(context); @@ -59,15 +56,12 @@ class _ReviewAppState extends State { }); } else { if (_likesTheApp == true) { - if (await inAppReview.isAvailable()) { - inAppReview.requestReview(); + if (await AppReview.isAvailable()) { + AppReview.requestReview(); } else if (kIsWeb || isLinux()) { launch(getRateAppURL(context)); } else { - inAppReview.openStoreListing( - appStoreId: kAppStoreId, - microsoftStoreId: kMicrosoftAppStoreId, - ); + AppReview.openStoreListing(); } } else { showDialog( diff --git a/lib/utils/review.dart b/lib/utils/review.dart new file mode 100644 index 00000000000..e8aaa86094b --- /dev/null +++ b/lib/utils/review.dart @@ -0,0 +1,13 @@ +import 'package:in_app_review/in_app_review.dart'; +import 'package:invoiceninja_flutter/constants.dart'; + +class AppReview { + static final InAppReview inAppReview = InAppReview.instance; + + static Future isAvailable() async => await inAppReview.isAvailable(); + + static void requestReview() => inAppReview.requestReview(); + + static void openStoreListing() => inAppReview.openStoreListing( + appStoreId: kAppStoreId, microsoftStoreId: kMicrosoftAppStoreId); +} diff --git a/lib/utils/review.dart.foss b/lib/utils/review.dart.foss new file mode 100644 index 00000000000..713b9af7b0f --- /dev/null +++ b/lib/utils/review.dart.foss @@ -0,0 +1,12 @@ +import 'package:invoiceninja_flutter/main_app.dart'; +import 'package:invoiceninja_flutter/utils/platforms.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class AppReview { + static Future isAvailable() async => false; + + static void requestReview() => null; + + static void openStoreListing() => + launch(getRateAppURL(navigatorKey.currentContext)); +} diff --git a/pubspec.foss.yaml b/pubspec.foss.yaml index f1132d8e48c..51dcbfb7211 100644 --- a/pubspec.foss.yaml +++ b/pubspec.foss.yaml @@ -21,6 +21,7 @@ dependencies: flutter_localizations: sdk: flutter # google_sign_in: ^5.0.7 + # in_app_review: ^2.0.4 flutter_redux: ^0.8.2 redux_logging: ^0.5.0 http: ^0.13.3 @@ -71,7 +72,6 @@ dependencies: printing: ^5.8.0 image_cropper: ^2.0.2 msal_js: ^2.14.0 - in_app_review: ^2.0.4 # bitsdojo_window: ^0.1.2 # quick_actions: ^0.2.1 # idb_shim: ^1.11.1+1 diff --git a/pubspec.next.yaml b/pubspec.next.yaml index 707c3f82b25..03d0b327522 100644 --- a/pubspec.next.yaml +++ b/pubspec.next.yaml @@ -21,6 +21,7 @@ dependencies: flutter_localizations: sdk: flutter google_sign_in: ^5.0.7 + in_app_review: ^2.0.4 flutter_redux: ^0.8.2 redux_logging: ^0.5.0 http: ^0.13.3 @@ -70,7 +71,6 @@ dependencies: printing: ^5.8.0 image_cropper: ^2.0.2 msal_js: ^2.14.0 - in_app_review: ^2.0.4 # bitsdojo_window: ^0.1.2 # quick_actions: ^0.2.1 # idb_shim: ^1.11.1+1 diff --git a/pubspec.yaml b/pubspec.yaml index 7586b97abba..cf498d9872c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,6 +21,7 @@ dependencies: flutter_localizations: sdk: flutter google_sign_in: ^5.0.7 + in_app_review: ^2.0.4 flutter_redux: ^0.8.2 redux_logging: ^0.5.0 http: ^0.13.3 @@ -71,7 +72,6 @@ dependencies: printing: ^5.8.0 image_cropper: ^2.0.2 msal_js: ^2.14.0 - in_app_review: ^2.0.4 # bitsdojo_window: ^0.1.2 # quick_actions: ^0.2.1 # idb_shim: ^1.11.1+1 From 59ee7398bc151b6c1ba241daafeb1507138b22af Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 6 Jul 2022 10:23:04 +0300 Subject: [PATCH 08/11] App review --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1890aed68ee..b9f2c551abe 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Note: if you don't have an Invoice Ninja backend setup you can test the app with ``` cp android/build.gradle.foss android/build.gradle cp lib/utils/oauth.dart.foss lib/utils/oauth.dart +cp lib/utils/review.dart.foss lib/utils/review.dart cp lib/ui/app/upgrade_dialog.dart.foss lib/ui/app/upgrade_dialog.dart cp android/app/src/main/AndroidManifest.foss.xml android/app/src/main/AndroidManifest.xml cp pubspec.foss.yaml pubspec.yaml From 0b66ae8686aafea0363a204a0a63d11cba77e270 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 6 Jul 2022 11:35:17 +0300 Subject: [PATCH 09/11] App review --- ios/Podfile.lock | 6 ++++++ ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ lib/constants.dart | 8 +++++--- lib/utils/review.dart | 3 ++- macos/Podfile.lock | 6 ++++++ macos/Runner.xcodeproj/project.pbxproj | 12 ++++++------ 6 files changed, 31 insertions(+), 16 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 78067478122..2f8d6bcf07f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -61,6 +61,8 @@ PODS: - TOCropViewController (~> 2.6.1) - image_picker_ios (0.0.1): - Flutter + - in_app_review (0.2.0): + - Flutter - local_auth (0.0.1): - Flutter - package_info (0.0.1): @@ -104,6 +106,7 @@ DEPENDENCIES: - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) + - in_app_review (from `.symlinks/plugins/in_app_review/ios`) - local_auth (from `.symlinks/plugins/local_auth/ios`) - package_info (from `.symlinks/plugins/package_info/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) @@ -144,6 +147,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/image_cropper/ios" image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" + in_app_review: + :path: ".symlinks/plugins/in_app_review/ios" local_auth: :path: ".symlinks/plugins/local_auth/ios" package_info: @@ -183,6 +188,7 @@ SPEC CHECKSUMS: GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba image_cropper: 60c2789d1f1a78c873235d4319ca0c34a69f2d98 image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb + in_app_review: 4a97249f7a2f539a0f294c2d9196b7fe35e49541 local_auth: 1740f55d7af0a2e2a8684ce225fe79d8931e808c package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 829f014240f..c0772e01fb6 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -372,7 +372,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 86; + CURRENT_PROJECT_VERSION = 87; DEVELOPMENT_TEAM = NPC44Y2C98; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -380,7 +380,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 5.0.86; + MARKETING_VERSION = 5.0.87; PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -502,7 +502,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 86; + CURRENT_PROJECT_VERSION = 87; DEVELOPMENT_TEAM = NPC44Y2C98; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -510,7 +510,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 5.0.86; + MARKETING_VERSION = 5.0.87; PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -526,7 +526,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 86; + CURRENT_PROJECT_VERSION = 87; DEVELOPMENT_TEAM = NPC44Y2C98; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -534,7 +534,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 5.0.86; + MARKETING_VERSION = 5.0.87; PRODUCT_BUNDLE_IDENTIFIER = com.invoiceninja.app; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/constants.dart b/lib/constants.dart index b33d11dfb62..7e8a3943f15 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -25,12 +25,14 @@ const String kSourceCodeFrontend = 'https://github.com/invoiceninja/admin-portal'; const String kSourceCodeFrontendSDK = 'https://pub.dev/packages/invoiceninja'; -const String kAppStoreId = 'com.invoiceninja.app'; +const String kPlayStoreAppId = 'com.invoiceninja.app'; +const String kAppStoreAppId = 'id1503970375'; + const String kMicrosoftAppStoreId = '9n3f2bbcfdr6'; const String kAppleStoreUrl = - 'https://apps.apple.com/us/app/invoice-ninja-v5/id1503970375'; + 'https://apps.apple.com/us/app/invoice-ninja-v5/$kAppStoreAppId'; const String kGoogleStoreUrl = - 'https://play.google.com/store/apps/details?id=$kAppStoreId'; + 'https://play.google.com/store/apps/details?id=$kPlayStoreAppId'; const String kGoogleFDroidUrl = 'https://f-droid.org/packages/com.invoiceninja.app'; const String kMacOSUrl = 'https://apps.apple.com/app/id1503970375'; diff --git a/lib/utils/review.dart b/lib/utils/review.dart index e8aaa86094b..e41289bcbb2 100644 --- a/lib/utils/review.dart +++ b/lib/utils/review.dart @@ -1,5 +1,6 @@ import 'package:in_app_review/in_app_review.dart'; import 'package:invoiceninja_flutter/constants.dart'; +import 'package:invoiceninja_flutter/utils/platforms.dart'; class AppReview { static final InAppReview inAppReview = InAppReview.instance; @@ -9,5 +10,5 @@ class AppReview { static void requestReview() => inAppReview.requestReview(); static void openStoreListing() => inAppReview.openStoreListing( - appStoreId: kAppStoreId, microsoftStoreId: kMicrosoftAppStoreId); + appStoreId: isAndroid() ? kPlayStoreAppId : kAppStoreAppId, microsoftStoreId: kMicrosoftAppStoreId); } diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 5174a316147..1b272758ed6 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -3,6 +3,8 @@ PODS: - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) + - in_app_review (0.2.0): + - FlutterMacOS - package_info (0.0.1): - FlutterMacOS - package_info_plus_macos (0.0.1): @@ -28,6 +30,7 @@ PODS: DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) + - in_app_review (from `Flutter/ephemeral/.symlinks/plugins/in_app_review/macos`) - package_info (from `Flutter/ephemeral/.symlinks/plugins/package_info/macos`) - package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`) - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) @@ -45,6 +48,8 @@ SPEC REPOS: EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral + in_app_review: + :path: Flutter/ephemeral/.symlinks/plugins/in_app_review/macos package_info: :path: Flutter/ephemeral/.symlinks/plugins/package_info/macos package_info_plus_macos: @@ -65,6 +70,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + in_app_review: a850789fad746e89bce03d4aeee8078b45a53fd0 package_info: 6eba2fd8d3371dda2d85c8db6fe97488f24b74b2 package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c path_provider_macos: 160cab0d5461f0c0e02995469a98f24bdb9a3f1f diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 272f7e627b9..9ed4fa9bb69 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -420,13 +420,13 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 86; + CURRENT_PROJECT_VERSION = 87; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 5.0.86; + MARKETING_VERSION = 5.0.87; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; }; @@ -548,13 +548,13 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 86; + CURRENT_PROJECT_VERSION = 87; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 5.0.86; + MARKETING_VERSION = 5.0.87; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -570,13 +570,13 @@ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 86; + CURRENT_PROJECT_VERSION = 87; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 5.0.86; + MARKETING_VERSION = 5.0.87; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; }; From bbf3295164e4461d5b1da571186d6e1bfff63f30 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 6 Jul 2022 11:36:03 +0300 Subject: [PATCH 10/11] Update version --- lib/constants.dart | 2 +- pubspec.foss.yaml | 2 +- pubspec.next.yaml | 2 +- pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/constants.dart b/lib/constants.dart index b33d11dfb62..8d8a9e8d28f 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -4,7 +4,7 @@ class Constants { } // TODO remove version once #46609 is fixed -const String kClientVersion = '5.0.86'; +const String kClientVersion = '5.0.87'; const String kMinServerVersion = '5.0.4'; const String kAppName = 'Invoice Ninja'; diff --git a/pubspec.foss.yaml b/pubspec.foss.yaml index 51dcbfb7211..ad2202ff668 100644 --- a/pubspec.foss.yaml +++ b/pubspec.foss.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.86+86 +version: 5.0.87+87 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none diff --git a/pubspec.next.yaml b/pubspec.next.yaml index 03d0b327522..ce8fcf5ba9e 100644 --- a/pubspec.next.yaml +++ b/pubspec.next.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.86+86 +version: 5.0.87+87 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none diff --git a/pubspec.yaml b/pubspec.yaml index cf498d9872c..580407377fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: invoiceninja_flutter description: Client for Invoice Ninja -version: 5.0.86+86 +version: 5.0.87+87 homepage: https://invoiceninja.com documentation: https://invoiceninja.github.io publish_to: none From 518e960741aa1bfddfa0f3e275a44c177b28ce79 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 6 Jul 2022 11:50:34 +0300 Subject: [PATCH 11/11] App review --- android/gradle.properties | 5 ++--- lib/ui/app/review_app.dart | 5 ++++- lib/utils/review.dart | 3 ++- snap/snapcraft.yaml | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index 8dcb4c354fe..fb427da49a8 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,6 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true -android.enableJetifier=true +android.enableJetifier=false android.enableR8=true -android.enableDexingArtifactTransform=false -android.jetifier.blacklist=bcprov \ No newline at end of file +android.enableDexingArtifactTransform=false \ No newline at end of file diff --git a/lib/ui/app/review_app.dart b/lib/ui/app/review_app.dart index 3da7847c7b5..c38879e5b68 100644 --- a/lib/ui/app/review_app.dart +++ b/lib/ui/app/review_app.dart @@ -56,7 +56,10 @@ class _ReviewAppState extends State { }); } else { if (_likesTheApp == true) { - if (await AppReview.isAvailable()) { + // TODO remove this code: https://github.com/britannio/in_app_review/issues/56 + if (isAndroid()) { + AppReview.openStoreListing(); + } else if (await AppReview.isAvailable()) { AppReview.requestReview(); } else if (kIsWeb || isLinux()) { launch(getRateAppURL(context)); diff --git a/lib/utils/review.dart b/lib/utils/review.dart index e41289bcbb2..49f38b5f135 100644 --- a/lib/utils/review.dart +++ b/lib/utils/review.dart @@ -10,5 +10,6 @@ class AppReview { static void requestReview() => inAppReview.requestReview(); static void openStoreListing() => inAppReview.openStoreListing( - appStoreId: isAndroid() ? kPlayStoreAppId : kAppStoreAppId, microsoftStoreId: kMicrosoftAppStoreId); + appStoreId: isAndroid() ? kPlayStoreAppId : kAppStoreAppId, + microsoftStoreId: kMicrosoftAppStoreId); } diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 66ec23d1bae..0d10e71afe8 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: invoiceninja -version: '5.0.86' +version: '5.0.87' summary: Create invoices, accept payments, track expenses & time-tasks description: "### Note: if the app fails to run using `snap run invoiceninja` it may help to run `/snap/invoiceninja/current/bin/invoiceninja` instead