Reputation: 69
I would like to know if it is possible to share the Imessage stickers in whatsapp. If it is possible how can I code the app for that?
Upvotes: 3
Views: 15743
Reputation: 863
Download sample project and required files from GitHub: https://github.com/WhatsApp/stickers/tree/master/iOS
Then create a sticker pack using below code:
let stickerPack = StickerPack(identifier: "identifier",
name: "sticker pack name",
publisher: "sticker pack publisher",
trayImageFileName: "tray image file name",
publisherWebsite: "publisher website URL",
privacyPolicyWebsite: "privacy policy website URL",
licenseAgreementWebsite: "license agreement website URL")
Add stickers to sticker pack:
stickerPack.addSticker(contentsOfFile: "file name of sticker image",
emojis: ["array of emojis"])
Call below method to import your sticker pack to Whatsapp:
stickerPack.sendToWhatsApp { completed in
// Called when the sticker pack has been wrapped in a form that WhatsApp
// can read and WhatsApp is about to open.
}
You have to add LSApplicationQueriesSchemes
in Info.plist
file:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
</array>
Also, There is some limitations and predefined syntax you have to use, Read more about creating whatsapp stickers:
https://faq.whatsapp.com/general/26000226
Upvotes: 4
Reputation: 2936
To do that, you need to build a separate keyboard extension with the stickers so that in WhatsApp they will be sent as images or GIFs.
Upvotes: 1