Hi everyone!
Thank you for bringing this to our attention - we’ve been able to have a look at the issues here and were successfully able to find a solution. The README should now be updated and we will be updating the docs to reflect this change
You should now be able to use the package something like this:
// Get canvas from dom
const canvas = document.querySelector('canvas');
// Convert canvas data to url
const url = canvas!.toDataURL('image/jpeg', 0.8);
ZapparWebGLSnapshot({
data: url,
fileNamePrepend: 'Zappar',
shareUrl: 'www.zappar.com',
shareTitle: 'Hello World!',
shareText: 'Hello World!',
onSave: () => {
console.log('Image was saved');
},
onShare: () => {
console.log('Share button was pressed');
},
onClose: () => {
console.log('Dialog was closed');
},
}, {}, {
SAVE: 'SAVE',
SHARE: 'SHARE',
NowOpenFilesAppToShare: 'Now open files app to share',
TapAndHoldToSave: 'Tap and hold the image<br/>to save to your Photos app',
});
Have a great day!
Francesca