🗯️
Chat SDK
  • Chat SDK Docs
  • Guides
    • Android Docs
    • iOS Docs
    • API Cheat Sheet
    • Best Practices and Troubleshooting
    • Custom Token Authentication
    • Firebase Schema
    • Custom File Upload Handler
  • Commercial
    • Module Licensing
    • Consulting Charges
    • Scalability and Cost
    • Firebase vs. Firestream vs. XMPP
    • Licensing FAQ
    • Adding Modules from source
  • XMPP
    • XMPP Setup Guide
  • About Us
    • History of Chat SDK
  • Architecture
    • Backend Agnostic Architecture
  • Modules
    • Sticker Message Module
Powered by GitBook
On this page

Was this helpful?

  1. Modules

Sticker Message Module

There are two ways to add extra sticker packs. Using a plist configuration file or programmatically. The following image formats are supported: png,gif.

Plist

Create a new plist file with the following format:

[
    {
        icon: "pack-icon.png",
        stickers: [
            "sticker1.png",
            "sticker2.png",
            ...
        ]
    }, ...
]

Then tell the app to use your plist file:

ChatSDK.builder()
    ...
    .build()
    ...
    .addModule(StickerMessageModule.builder()
    .setLoadStickersFromPlist(R.raw.stickers_plist)
    .build())
    ...
StickerMessageModule.shared().setCustomStickers(plist: "plist_name", bundle: Bundle.main)

The bundle should be where both plist file and the stickers are located.

Programatically

Stickers can also be added programmatically.

StickerPack pack = new StickerPack(R.drawable.icon);
pack.addSticker(R.drawable.sticker_1, "sticker_1.png");
pack.addSticker(R.drawable.sticker_2, "sticker_2.png");

StickerMessageModule module = StickerMessageModule.builder()
    .setLoadStickersFromPlist(false)
    .build();

module.addPack(pack);

ChatSDK.builder()
    ...
    .build()
    ...
    .addModule(module)
    ...
let sticker1 = Sticker(image: "image1.gif", sound: "sound.caf")
let sticker2 = Sticker(image: "image2.gif", sound: "sound.caf")

let pack = StickerPack(icon: "pack-icon.png", stickers: [
    sticker1,
    sticker2,
])

StickerMessageModule.shared().addPack(pack)
StickerMessageModule.shared().loadStickersFromPlist = false

PreviousBackend Agnostic Architecture

Last updated 4 years ago

Was this helpful?