Android icon indicating copy to clipboard operation
Android copied to clipboard

Share Catima card(s) as file

Open TheLastProject opened this issue 6 months ago • 2 comments

Currently, Catima cards are shared as links, without images, so non-Catima users can also open them. Sharing images like that will create a way too big link or will require a place to upload to.

Consider perhaps sharing Catima cards as files (only openable by other Catima users) with images included. The backup code can probably be reused for this, just exporting/importing a more limited amount of cards.

This would enable sharing over Bluetooth and perhaps NFC too (not sure about NFC file size limit)

TheLastProject avatar May 08 '25 20:05 TheLastProject

Hi! I’d like to contribute to this feature.

Sharing Catima cards as files sounds like a great idea for offline and private sharing. Maybe we could reuse the backup/export code to generate a file with the card and image, then send it using Android’s share menu.

I’m happy to help implement this — let me know if it’s okay to start!

hajertabbane avatar May 13 '25 22:05 hajertabbane

Reusing the backup/export code sounds like a plan. However, we'd have to make sure we only export 1 card and not export group info (as that is part of the personal organization, not the card). And we somehow need to open it in the edit activity instead of directly save it into the app through the importer.

The changes made for pkpass support would probably make it fairly easy to load a ".catima card file" when selecting it, but exporting it from the share menu may be a bit more challenging (but should be doable).

The biggest difference between a Catima card file and a backup will be that the card file will not contain group info (as that is personal sorting data, not card data) and will only be 1 card, not a list of cards.

Perhaps the easiest method to allow code sharing with the backup feature would be to create some toCSV and fromCSV functions on the LoyaltyCard (like we currently have toBundle and fromBundle), move the shared part of the current CSV code in exporter/importer there and have the new functions used by both the new file share and exporter/importer. But I'm just brainstorming a bit now, I may be missing some things :)

TheLastProject avatar May 14 '25 06:05 TheLastProject