Ultimate Cordova Plugin for WhatsApp Stickers to monetize hybrid apps. Add Stickers to WhatsApp with single line of JavaScript. Compatible with Cordova CLI, PhoneGap Build, Ionic, etc.
npm install cordova-codeplay-whatsapp-stickers
bash
# install cordova CLI
[sudo] npm install cordova -g
# install a small utility to run all the commands for you
[sudo] npm install plugin-verify -g
# Demo: run tapsell plus demo with sample index.html
plugin-verify cordova-codeplay-whatsapp-stickers
`
Quick start
`bash
# create a demo project
cordova create test1 com.miladesign.sw Test1
cd test1
cordova platform add android
# now add the plugin, cordova CLI will handle dependency automatically
cordova plugin add cordova-codeplay-whatsapp-stickers
# now remove the default www content, copy the demo html file to www
rm -r www/*;
cp plugins/cordova-codeplay-whatsapp-stickers/test/* www/;
# now build and run the demo in your device or emulator
cordova prepare;
cordova run android;
# or import into eclipse
`
Installation
* If use with Cordova CLI:
`bash
cordova plugin add cordova-codeplay-whatsapp-stickers
`
* If use with PhoneGap Build:
`xml
`
Notice:
* If build locally using `cordova-codeplay-whatsapp-stickers`, to avoid build error, you need install some extras in Android SDK manager (type `android sdk` to launch it):
!android extra
Usage
Add sticker pack to WhatsApp.
Step 1: Place your stickers inside www folder.
Step 2: Edit contents.json file and place it inside www folder.
$3
Step 3: To add sticker pack to WhatsApp call this function:
`javascript
function addToWhatsApp(identifier, name) {
jsonObject = { "identifier": identifier, "name": name };
json = JSON.stringify(jsonObject);
window.WhatsAppStickers.addToWhatsApp(json, function() { alert(name + " Added to WhatsApp"); }, function(e) { alert("Error. Message: " + e); });
}
`
Read more about stickers from WhatsApp
$3
Step 3: To add sticker pack to WhatsApp use this code.
`javascript
data = {
ios_app_store_link: '',
android_play_store_link: '',
identifier: 'PACK ID',
name: 'PACK NAME',
publisher: 'PUBLISHER NAME',
publisher_website: '',
privacy_policy_website: '',
license_agreement_website: '',
image_data_version: '1',
avoid_cache: false,
tray_image: 'PNG IN BASE64',
stickers: [
{
image_data: 'WEBP IN BASE64',
emojis: ["☕", "🙂"]
},
{
image_data: 'WEBP IN BASE64',
emojis: ["☕", "🙂"]
},
{
image_data: 'WEBP IN BASE64',
emojis: ["☕", "🙂"]
},
]
};
json = JSON.stringify(data);
window.WhatsAppStickers.addToWhatsApp(json, function() { alert(name + " Added to WhatsApp"); }, function(e) { alert("Error. Message: " + e); });
``