Skip to content

Connot add multiple passes #38

@akashsharma08

Description

@akashsharma08

I think currently we cannot add multiple passes in one go, I am having an array of passesi want to add all these passes to wallet with a single action.

The code I am using :

getPass(
{
ticketId
},
{
onSuccess: async res => {
try {
const urls = res.data.passKitUrls?.map(url => CDN_URL + url);
const isAvailable = await WalletManager.canAddPasses();
if (!isAvailable) {
throw new Error('Apple Wallet not supported on this device.');
}
let results = [];
for (let i = 0; i < urls.length; i++) {
try {
const result = await WalletManager.addPassFromUrl(urls[i]);
results.push(result);
} catch (err) {
console.error(Pass #${i + 1} failed:, err);
}
}
if (results.every(r => r)) {
console.log('results', results);
Alert.alert('Success', 'All passes added to Apple Wallet');
} else {
Alert.alert('Partial Success', 'Some passes could not be added');
}
} catch (err: any) {
console.error('Wallet Error:', err);
}
},
onError: err => {
console.error('Failed to get pass:', err.response?.data.message);
}
}
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions