This is my code:
sendPack () {
if(this.state.isAvailable == false){
return Alert.alert('whatsapp is not available');
}
const { stickers, ...packConfig } = stickerConfig;
if (Platform.OS === 'ios') {
return RNWhatsAppStickers.createStickerPack(packConfig)
.then(() => {
const promises = stickers.map(item =>
RNWhatsAppStickers.addSticker(item.fileName, item.emojis)
)
Promise.all(promises).then(() => RNWhatsAppStickers.send())
})
.catch(e => console.log(e))
}
stickerConfig.js:
export const stickerConfig = {
identifier: 'myprojectstickers',
name: 'myprojectstickers',
publisher: "info@company.com", // i'm adding my real email
trayImageFileName: 'tray.png',
publisher_email: "info@company.com", // i'm adding my real email
publisherWebsite: 'https://website.com/', // i'm adding my real website
stickers: [
{
fileName: "sticker1.webp",
emojis: ['😎'],
},
{
fileName: "sticker2.webp",
emojis: ['😎'],
},
{
fileName: "sticker3.webp",
emojis: ['😎'],
},
]
}
I'm placing my folder containing the stickers(myprojectstickers) in the same directory of my stickerConfig file, and I drag it to Xcode as mentioned to do.
I'm getting the following error only on IOS: Error: an unknown error occured for whats app stickers
Error is occurring when creating the sticker pack.
Knowing that I'm following IOS stickers guidelines.
Any help please? Thank you in advance.
This is my code: sendPack () { if(this.state.isAvailable == false){ return Alert.alert('whatsapp is not available'); } const { stickers, ...packConfig } = stickerConfig; if (Platform.OS === 'ios') { return RNWhatsAppStickers.createStickerPack(packConfig) .then(() => { const promises = stickers.map(item => RNWhatsAppStickers.addSticker(item.fileName, item.emojis) ) Promise.all(promises).then(() => RNWhatsAppStickers.send()) }) .catch(e => console.log(e)) }
stickerConfig.js: export const stickerConfig = { identifier: 'myprojectstickers', name: 'myprojectstickers', publisher: "info@company.com", // i'm adding my real email trayImageFileName: 'tray.png', publisher_email: "info@company.com", // i'm adding my real email publisherWebsite: 'https://website.com/', // i'm adding my real website stickers: [ { fileName: "sticker1.webp", emojis: ['😎'], }, { fileName: "sticker2.webp", emojis: ['😎'], }, { fileName: "sticker3.webp", emojis: ['😎'], }, ] }
I'm placing my folder containing the stickers(myprojectstickers) in the same directory of my stickerConfig file, and I drag it to Xcode as mentioned to do. I'm getting the following error only on IOS: Error: an unknown error occured for whats app stickers Error is occurring when creating the sticker pack. Knowing that I'm following IOS stickers guidelines. Any help please? Thank you in advance.