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

Adding to Apple health/wallet #17

Open
daniellrgn opened this issue Apr 25, 2024 · 0 comments
Open

Adding to Apple health/wallet #17

daniellrgn opened this issue Apr 25, 2024 · 0 comments

Comments

@daniellrgn
Copy link
Collaborator

daniellrgn commented Apr 25, 2024

To support COVID-19 SMART Health Cards, Apple added a URL scheme for importing SHC content, as well as detection of QR codes containing SHC data. Whether the data included in the URL fits in a QR code or not, the content can be added to Apple Health. Given the SHC data does fit in a QR code, it will also automatically create a wallet entry with the SHC QR code.

SHL in Apple Wallet

Since SHL content is often too large for a QR code, using the same methods with the SHC contained in a SHL only imports the data to Apple Health and does not automatically create a Wallet entry. Ideally, a Wallet entry would include the SHL and metadata like its label, expiration, etc., but this would have to be custom-made (requires Apple Developer registration, card design, and wallet certification).

SHL in Apple Health

An SHL can't yet be added directly to Apple Health, but its SHC content can. To add an SHL's SHC record to Apple Health, add Apple's button w/url like https://redirect.health.apple.com/SMARTHealthCard/[encoded shc] where the encoded SHC is the output of

let str = shc_jws;
let numericEncodings = [];
for (let i=0; i<str.length; i++) {
  let c = str.charCodeAt(i) - 45;
  if (c < 10) {
    c = "0"+c;
  } else {
     c = c.toString();
  }
  numericEncodings.push(c);
}
let num = numericEncodings.join("");
return num;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant