Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ApiClient/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:";
Expand Down
26 changes: 13 additions & 13 deletions src/MobileUI/Features/Scanner/ScanViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/MobileUI/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ssw.consulting" android:versionCode="83" android:versionName="3.0.44">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ssw.consulting" android:versionCode="84" android:versionName="3.0.45">
<application android:allowBackup="false" android:icon="@mipmap/icon_android_dark" android:supportsRtl="true" android:label="SSW Rewards">
<meta-data android:name="google_analytics_automatic_screen_reporting_enabled" android:value="false" />
</application>
Expand Down
2 changes: 1 addition & 1 deletion src/MobileUI/Platforms/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<key>CFBundleVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
<string>3.0.44</string>
<string>3.0.45</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
3 changes: 1 addition & 2 deletions src/MobileUI/Services/ScannerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ public async Task<ScanResponseViewModel> 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);
}
Expand Down
Loading