diff --git a/src/ApiClient/Constants.cs b/src/ApiClient/Constants.cs index 2e03b746a..c793b836a 100644 --- a/src/ApiClient/Constants.cs +++ b/src/ApiClient/Constants.cs @@ -9,7 +9,7 @@ public class Constants public const string RewardsAppClientName_MobileApp = "MobileApp"; // QR Code Constants (e.g. sswrewards://redeem?code={{ach:123456 in base64}}) - public const string RewardsQRCodeProtocol = "sswrewards://"; + public const string RewardsQRCodeProtocol = "sswrewards"; public const string RewardsQRCodeProtocolQueryName = "code"; public const string RewardsQRCodeAchievementPrefix = "ach:"; diff --git a/src/MobileUI/Features/Scanner/ScanViewModel.cs b/src/MobileUI/Features/Scanner/ScanViewModel.cs index 727be91f0..14cd5ac02 100644 --- a/src/MobileUI/Features/Scanner/ScanViewModel.cs +++ b/src/MobileUI/Features/Scanner/ScanViewModel.cs @@ -136,22 +136,22 @@ public void SetSegment(ScanPageSegments segment) [RelayCommand] private void DetectionFinished(BarcodeResult[] result) { - // the handler is called on a thread-pool thread - App.Current.Dispatcher.Dispatch(() => + if (!IsCameraEnabled || result.Length == 0) { - if (!IsCameraEnabled || result.Length == 0) - { - return; - } + return; + } - // Go through all detected barcodes and find the first valid QR code. - var validBarCode = result.FirstOrDefault(x => _resultViewModel.IsQRCodeValid(x?.RawValue)); - string rawValue = validBarCode?.RawValue; - if (string.IsNullOrWhiteSpace(rawValue)) - { - return; - } + // Go through all detected barcodes and find the first valid QR code. + var validBarCode = result.FirstOrDefault(x => _resultViewModel.IsQRCodeValid(x?.RawValue)); + string rawValue = validBarCode?.RawValue; + if (string.IsNullOrWhiteSpace(rawValue)) + { + return; + } + // the handler is called on a thread-pool thread + App.Current.Dispatcher.Dispatch(() => + { IsCameraEnabled = false; var popup = new PopupPages.ScanResult(_resultViewModel, rawValue); diff --git a/src/MobileUI/Platforms/Android/AndroidManifest.xml b/src/MobileUI/Platforms/Android/AndroidManifest.xml index e54a61b93..c00bd9f58 100644 --- a/src/MobileUI/Platforms/Android/AndroidManifest.xml +++ b/src/MobileUI/Platforms/Android/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/src/MobileUI/Platforms/iOS/Info.plist b/src/MobileUI/Platforms/iOS/Info.plist index 3d4e554f6..97ac8a203 100644 --- a/src/MobileUI/Platforms/iOS/Info.plist +++ b/src/MobileUI/Platforms/iOS/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion 1 CFBundleShortVersionString - 3.0.44 + 3.0.45 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/src/MobileUI/Services/ScannerService.cs b/src/MobileUI/Services/ScannerService.cs index 076dcee35..ed33c6bf1 100644 --- a/src/MobileUI/Services/ScannerService.cs +++ b/src/MobileUI/Services/ScannerService.cs @@ -194,9 +194,8 @@ public async Task ValidateQRCodeAsync(string rawQRCodeDat private static (string decodedCode, string codeToSend) DecodeQRCode(string qrCodeData) { - if (qrCodeData.StartsWith(ApiClientConstants.RewardsQRCodeProtocol)) + if (qrCodeData.StartsWith(ApiClientConstants.RewardsQRCodeProtocol) && Uri.TryCreate(qrCodeData, UriKind.Absolute, out Uri uri)) { - var uri = new Uri(qrCodeData); var queryDictionary = System.Web.HttpUtility.ParseQueryString(uri.Query); qrCodeData = queryDictionary.Get(ApiClientConstants.RewardsQRCodeProtocolQueryName); }