Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Fixed AppLink at the end of service #1148

Merged
1 commit merged into from
Sep 20, 2022
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
15 changes: 1 addition & 14 deletions Covid19Radar/Covid19Radar.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,7 @@ private async Task NavigateToDestinationFromIntent(Intent intent)
{
_loggerService.Value.Info("Intent has data.");

var processingNumber = intent.Data.GetQueryParameter(AppConstants.LinkQueryKeyProcessingNumber);

if (processingNumber != null && Validator.IsValidProcessingNumber(processingNumber))
{
_loggerService.Value.Info("ProcessingNumber is valid.");

var navigationParameters = NotifyOtherPage.BuildNavigationParams(processingNumber);
await AppInstance?.NavigateToSplashAsync(Destination.NotifyOtherPage, navigationParameters);
}
else
{
_loggerService.Value.Error("Failed to navigate NotifyOtherPage with invalid processingNumber");
await AppInstance?.NavigateToSplashAsync(Destination.EndOfServiceNotice, new NavigationParameters());
}
await AppInstance?.NavigateToSplashAsync(Destination.EndOfServiceNotice, new NavigationParameters());
}
else if (intent.HasExtra(EXTRA_KEY_DESTINATION))
{
Expand Down
16 changes: 1 addition & 15 deletions Covid19Radar/Covid19Radar.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,21 +234,7 @@ private void NavigateUniversalLinks(NSUrl url)
var urlComponents = new NSUrlComponents(url, true);
if (urlComponents.Path?.StartsWith("/cocoa/a/") == true)
{
var processingNumber = urlComponents
.QueryItems?
.FirstOrDefault(item => item.Name == AppConstants.LinkQueryKeyProcessingNumber)?
.Value;

if (processingNumber != null && Validator.IsValidProcessingNumber(processingNumber))
{
var navigationParameters = NotifyOtherPage.BuildNavigationParams(processingNumber);
InvokeOnMainThread(async () => await AppInstance?.NavigateToSplashAsync(Destination.NotifyOtherPage, navigationParameters));
}
else
{
_loggerService.Value.Error("Failed to navigate NotifyOtherPage with invalid processingNumber");
InvokeOnMainThread(async () => await AppInstance?.NavigateToSplashAsync(Destination.EndOfServiceNotice, new NavigationParameters()));
}
InvokeOnMainThread(async () => await AppInstance?.NavigateToSplashAsync(Destination.EndOfServiceNotice, new NavigationParameters()));
}
}
catch(Exception e)
Expand Down
4 changes: 4 additions & 0 deletions Covid19Radar/Covid19Radar.iOS/EntitlementsDebug.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<dict>
<key>com.apple.developer.exposure-notification</key>
<true/>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:www.mhlw.go.jp</string>
</array>
<key>com.apple.developer.exposure-notification-test</key>
<true/>
<key>com.apple.developer.exposure-notification-test-skip-file-verification</key>
Expand Down
1 change: 0 additions & 1 deletion Covid19Radar/Covid19Radar/Destination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public enum Destination : int
{
SplashPage,
ContactedNotifyPage,
NotifyOtherPage,
EndOfServiceNotice,
EndOfService,
}
Expand Down