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

iOSとAndroidでExposureInformationのDurationsの定義が異なる #36

Closed
3 tasks done
keiji opened this issue Jun 8, 2021 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working legacy v1

Comments

@keiji
Copy link
Owner

keiji commented Jun 8, 2021

ExposureInformationのAttenuationDurationsおよびAttenuationDurationsが、iOSでは「秒単位」であるのに対して、Androidでは「分単位」と定義が異なる。

ExposureInformation
https://developers.google.com/android/reference/com/google/android/gms/nearby/exposurenotification/ExposureInformation

ENExposureInfo.attenuationDurations
https://developer.apple.com/documentation/exposurenotification/enexposureinfo

An array that contains the duration, in seconds, at certain attenuations, using an aggregated maximum exposures of 30 minutes.

これらの違いを吸収する仕組みが現在のchinoに実装されておらず、iOSではInMinutesと言う変数名で値を取得しているので、接触確認後の処理が共通化できない。

Android版

public int[] AttenuationDurationsInMinutes => Source.GetAttenuationDurationsInMinutes();

  "exposure_informations": [
    {
      "AttenuationDurationsInMinutes": [
        1436,
        0,
        0
      ],
      "AttenuationValue": 26,
      "DateMillisSinceEpoch": 1622851200000,
      "Duration": 30.0,
      "TotalRiskScore": 256,
      "TransmissionRiskLevel": 4
    },

iOS版

public int[] AttenuationDurationsInMinutes => Source.AttenuationDurations;

  "exposure_informations": [
    {
      "AttenuationDurationsInMinutes": [
        1800,
        0,
        0,
        0
      ],
      "AttenuationValue": 4,
      "DateMillisSinceEpoch": 1622764800000,
      "Duration": 1800.0,
      "TotalRiskScore": 255,
      "TransmissionRiskLevel": 4
    },

Close条件

  • Durationの定義をどちらに寄せるか(秒か、分か)を決める
  • コードを修正する
  • 修正版をリリースする
@keiji keiji added bug Something isn't working legacy v1 labels Jun 9, 2021
@keiji
Copy link
Owner Author

keiji commented Jun 9, 2021

ExposureInformationAttenuationDurationsInMillisにする。

Chinoを通せば全部millisで取り扱えるようになっているようにする。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working legacy v1
Projects
None yet
Development

No branches or pull requests

1 participant