Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ExposureNotification] Support PreAuthorization #1133

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
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 Android/ExposureNotification/build.cake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var TARGET = Argument ("t", Argument ("target", "ci"));

var NUGET_VERSION = "19.7.1-eap.1";
var AAR_URL = "https://github.com/google/exposure-notifications-android/raw/a93e236997943408308e2b750966567ebdb8d3df/app/libs/play-services-nearby-exposurenotification-1.7.1-eap.aar";
var AAR_URL = "https://github.com/google/exposure-notifications-android/raw/c92f95287471a7a7b43c4e3c554bb4aff40d2ba1/app/libs/play-services-nearby-exposurenotification-1.8.3-eap.aar";

Task ("externals")
.Does (() =>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public async Task<PackageConfiguration> GetPackageConfigurationAsync()

public async Task<ExposureNotificationStatus> GetStatusAsync()
=> await NativeGetStatus().CastTask<ExposureNotificationStatus>();

public Task RequestPreAuthorizedTemporaryExposureKeyHistoryAsync()
=> NativeRequestPreAuthorizedTemporaryExposureKeyHistory().CastTask();

public Task RequestPreAuthorizedTemporaryExposureKeyReleaseAsync()
=> NativeRequestPreAuthorizedTemporaryExposureKeyRelease().CastTask();
}

internal static class GoogleTaskExtensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.GooglePlayServices.Base" Version="117.1.0-preview01" />
<PackageReference Include="Xamarin.GooglePlayServices.Basement" Version="117.1.0-preview01" />
<PackageReference Include="Xamarin.GooglePlayServices.Tasks" Version="117.0.0-preview01" />
<PackageReference Include="Xamarin.GooglePlayServices.Base" Version="117.6.0" />
<PackageReference Include="Xamarin.GooglePlayServices.Basement" Version="117.6.0" />
<PackageReference Include="Xamarin.GooglePlayServices.Tasks" Version="117.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@
<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='getPackageConfiguration']" name="managedName">NativeGetPackageConfiguration</attr>
<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='getStatus']" name="managedName">NativeGetStatus</attr>

<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='deviceSupportsLocationlessScanning']" name="propertyName">DeviceSupportsLocationlessScanning</attr>
<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='deviceSupportsLocationlessScanning']" name="managedName">GetDeviceSupportsLocationlessScanning</attr>
<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='deviceSupportsLocationlessScanning']" name="propertyName">DeviceSupportsLocationlessScanning</attr>
<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='deviceSupportsLocationlessScanning']" name="managedName">NativeDeviceSupportsLocationlessScanning</attr>

<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='requestPreAuthorizedTemporaryExposureKeyHistory']" name="managedName">NativeRequestPreAuthorizedTemporaryExposureKeyHistory</attr>
<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']/method[@name='requestPreAuthorizedTemporaryExposureKeyRelease']" name="managedName">NativeRequestPreAuthorizedTemporaryExposureKeyRelease</attr>

<!--<attr path="/api/package[@name='com.google.android.gms.nearby.exposurenotification']/interface[@name='ExposureNotificationClient']" name="extends"></attr>-->

Expand Down
15 changes: 15 additions & 0 deletions iOS/ExposureNotification/source/ApiDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ interface ENExposureInfo {
delegate void ENGetExposureInfoHandler ([NullAllowed] ENExposureInfo [] exposures, [NullAllowed] NSError error);
delegate void ENGetExposureWindowsHandler ([NullAllowed] ENExposureWindow [] exposureWindows, [NullAllowed] NSError error);
delegate void ENGetUserTraveledHandler (bool traveled, NSError error);
delegate void ENDiagnosisKeysAvailableHandler ([NullAllowed] ENTemporaryExposureKey [] keys);

[Introduced (PlatformName.iOS, 13, 5)]
[BaseType (typeof (NSObject))]
Expand Down Expand Up @@ -419,5 +420,19 @@ interface ENManager {
[Async]
[Export ("getTestDiagnosisKeysWithCompletionHandler:")]
void GetTestDiagnosisKeys (ENGetDiagnosisKeysHandler completionHandler);

[Introduced (PlatformName.iOS, 14, 4)]
[NullAllowed, Export ("diagnosisKeysAvailableHandler", ArgumentSemantic.Copy)]
ENDiagnosisKeysAvailableHandler DiagnosisKeysAvailableHandler { get; set; }

[Introduced (PlatformName.iOS, 14, 4)]
[Async]
[Export ("preAuthorizeDiagnosisKeysWithCompletionHandler:")]
void PreAuthorizeDiagnosisKeys (ENErrorHandler completionHandler);

[Introduced (PlatformName.iOS, 14, 4)]
[Async]
[Export ("requestPreAuthorizedDiagnosisKeysWithCompletionHandler:")]
void RequestPreAuthorizedDiagnosisKeys (ENErrorHandler completionHandler);
}
}