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

Commit

Permalink
Merge pull request #1148 from cocoa-mhlw/feature/disable-applink
Browse files Browse the repository at this point in the history
Fixed AppLink at the end of service
  • Loading branch information
cocoa-dev004 authored Sep 20, 2022
2 parents b806000 + bd13cd6 commit 6287e9d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
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

0 comments on commit 6287e9d

Please sign in to comment.