diff --git a/prototype/fastlane/Fastfile b/prototype/fastlane/Fastfile index 4c22db88..b9355c12 100644 --- a/prototype/fastlane/Fastfile +++ b/prototype/fastlane/Fastfile @@ -22,15 +22,15 @@ platform :ios do desc "Build app for TestFlight" lane :beta_ios do |options| # Set XCode version - xcversion(version: "15.4") + xcversion(version: "15.4") xcodes( version: '15.4', select_for_current_build_only: true, ) - + # Set up CI setup_ci() - + # Set parameters key_id = ENV['APP_STORE_KEY_ID'] issuer_id = ENV['APP_STORE_ISSUER_ID'] @@ -39,7 +39,7 @@ platform :ios do matchType = "appstore" app_identifier = "im.phnx.prototype" app_identifier_nse = "im.phnx.prototype.nse" - + # Load the app store connect API key api_key = app_store_connect_api_key( key_id: key_id, @@ -48,18 +48,23 @@ platform :ios do is_key_content_base64: true, in_house: false ) - - # Fetch the latest TestFlight build number and increment it by 1 - build_number = latest_testflight_build_number( - version: "1.0.0", - api_key: api_key, - app_identifier: app_identifier - ) + + # Determine build number + build_number = if options[:build_number] + options[:build_number].to_i + else + latest_testflight_build_number( + version: "1.0.0", + api_key: api_key, + app_identifier: app_identifier + ) + 1 + end + increment_build_number( xcodeproj: "ios/Runner.xcodeproj", - build_number: build_number + 1, + build_number: build_number, ) - + # Use match for code signing ["development", "appstore"].each do |i| match( @@ -73,10 +78,10 @@ platform :ios do readonly: is_ci, ) end - + # Install flutter dependencies sh "flutter pub get" - + # Install CocoaPods dependencies cocoapods( clean: true, @@ -89,7 +94,7 @@ platform :ios do scheme: "Runner", export_method: "app-store", ) - + # Upload the app to TestFlight if the parameter is set if options[:upload_to_test_flight] upload_to_testflight( diff --git a/prototype/ios/NotificationService/NotificationService.swift b/prototype/ios/NotificationService/NotificationService.swift index cb143aa3..b0e12a45 100644 --- a/prototype/ios/NotificationService/NotificationService.swift +++ b/prototype/ios/NotificationService/NotificationService.swift @@ -119,7 +119,10 @@ class NotificationService: UNNotificationServiceExtension { bestAttemptContent.body = lastNotification.body contentHandler(bestAttemptContent) } else { - contentHandler(UNNotificationContent()) + // Delay the callback by .1 seconds so that the notifications can be removed + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + contentHandler(UNNotificationContent()) + } } } }