Files
TREK/client/src/native/blobBase64.ts
T
Maurice 794da3be72 feat(native): booking passes go straight into Apple Wallet
Opening a .pkpass in the iOS app brought up the generic share sheet. It now
shows Wallet's own sheet with the pass and "Add", and a pass that is already in
Wallet opens there instead of being offered twice (TrekShell.addToWallet,
feature wallet). A broken pass or a device without Wallet falls back to the
share sheet as before.

Passes carry an "Apple Wallet" badge in the trip's files and a wallet icon
where they hang on a booking, so it is clear what a tap does.
2026-11-07 11:25:18 +01:00

10 lines
418 B
TypeScript

/** A Blob as plain base64 (no data: prefix), the way the native bridge takes bytes. */
export function toBase64(blob: Blob): Promise<string> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(String(reader.result).slice(String(reader.result).indexOf(',') + 1));
reader.onerror = () => reject(reader.error);
reader.readAsDataURL(blob);
});
}