mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 15:51:00 +00:00
794da3be72
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.
10 lines
418 B
TypeScript
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);
|
|
});
|
|
}
|