WhatsApp Stickers

repository·main·Indexed 25 days ago

https://github.com/whatsapp/stickers

Sample applications and APIs for developing third-party sticker pack applications for Android and iOS that integrate with WhatsApp. Includes technical specifications for static and animated stickers, WebP conversion guides, ContentProvider implementation for Android, and App Store submission guidelines for iOS.

Tokens
6.7K
Snippets
4
Records
32
Agent score
84%

What's inside whatsapp-stickers

  1. Important notice for iOS sticker app developers

    main

    Due to Apple's App Store review policies, submitting an app that only exports stickers is likely to be rejected.

    Recommendations:

    • Build apps that contain more functionality than just sticker exporting to increase the chances of App Store acceptance.
    • The sample iOS app provided in this repository is intended as an API usage guide only; do not use it as a direct template for your production app, as it may not be accepted by Apple.
    • Alternatively, consider using existing sticker maker apps to create and import stickers.
  2. Submit your sticker app to Google Play Store

    main

    Follow these guidelines for a successful submission:

    • Generate Release: In Android Studio, go to Build > Generate Signed Bundle/APK.
    • Naming Restrictions: Do not use the word "WhatsApp" in your app name or Play Store listing name. You may mention it in the app description.
    • SEO/Discovery: Add the keyword WAStickerApps to your app's description in the Google Play Store console to help it appear in WhatsApp's sticker search.
    • Optimization: To reduce app size, create Multiple APKs per ABI. In app/build.gradle, uncomment lines 47-52 to enable this.
  3. Prepare and build the sample app

    main

    Before building your release, perform these essential modifications to the sample app:

    1. App Icon: Update the launcher icons in SampleStickerApp/app/src/main/res (within mipmap folders). Use Android Image Asset Studio for this.
    2. App Name: Change the user-visible name in SampleStickerApp/app/src/main/res/values/strings.xml.
    3. Application ID: Change the applicationId in SampleStickerApp/app/build.gradle to a unique ID that does not exist on the Play Store.
    4. Build: Use Android Studio to build the app. If errors occur, check logcat for details.
  4. Create a sticker app using the sample app

    main

    To create a sticker app, use the provided sample app as a template. Follow these steps:

    1. Open Project: Open the Android folder of the sample app in Android Studio.
    2. Add Sticker Art: Navigate to SampleStickerApp/app/src/main/assets.
      • Replace the files in folder 1 with your own sticker files.
      • Replace the sample tray icon PNG with your own tray icon.
    3. Add Multiple Packs: To include more than one sticker pack, create additional folders (e.g., 2, 3, etc.) within the assets folder and place your art and tray icon in them.
    4. Update Metadata: You must modify the contents.json file located in SampleStickerApp/app/src/main/assets to reflect your new content.
  5. Convert Images to WebP

    main

    WebP is the recommended format for sticker art. You can convert PNGs to WebP using the following tools:

    • Sketch (Mac): Select a layer/artboard, select Make Exportable, choose WebP as the format, and set quality/resolution.
    • Android Studio: Right-click a PNG in a project and select convert to WebP. Crucial: Uncheck Skip images with transparency/alpha channel.
    • Photoshop: Use an Adobe WebM plugin. Crucial: Uncheck Save Metadata.
    • Command Line: Use cwebp.
    • Web Tool: Use Squoosh.
  6. Tips for reducing sticker file size

    main

    To ensure faster sending and lower data usage, aim for smaller file sizes (WhatsApp's internal stickers are often around 15KB). Use these two methods:

    1. PNG Optimization: Optimize your source PNGs using a tool like pngmini.com (macOS, use Median Cut) or Pngyu (Windows) before converting them to WebP.
    2. WebP Export Optimization: When exporting to WebP, experiment with the quality settings. Reducing the quality below 100% can significantly decrease file size without noticeable image degradation.
  7. Prepare and submit your iOS sticker app

    main

    Before publishing your sticker app to the App Store, ensure the following requirements are met:

    Bundle Identifier & App Name

    • Restriction: Your bundle identifier cannot include WA.WAStickersThirdParty.
    • To change the Bundle ID: Select the project root in Xcode and update the Bundle Identifier field.
    • To change the App Name: Update the Display Name field in the project settings.

    App Icon

    • In Assets.xcassets, update the iPhone App and App Store sections.
    • 2x icon: 120x120 pixels.
    • 3x icon: 180x180 pixels.
    • App Store icon: 1024x1024 pixels.

    App Store Keywords

    • To ensure WhatsApp can find your app, you must add the keyword WAStickers in App Store Connect.
  8. Integrate WhatsApp Sticker SDK (iOS)

    main

    To use the built-in helper classes for creating and sending sticker packs, you must include specific files in your Xcode project.

    Required Files to Copy

    • Limits.swift
    • StickerPackManager.swift
    • StickerPack.swift
    • Sticker.swift
    • ImageData.swift
    • Interoperability.swift
    • WebPManager.swift
    • All files with the YY prefix.

    Setup Requirements

    1. Bridging Header: Create a Bridging Header and add #import "YYImage.h".
    2. Frameworks: Add WebP.framework to your Linked Frameworks and Libraries.
  9. Convert sticker art to WebP

    main

    Sticker art must be converted to the WebP format. Supported workflows include:

    • Sketch (Mac): Use the "Make Exportable" feature, select WebP, and choose your quality/resolution.
    • Android Studio: Right-click a PNG in a project and select "convert to WebP". Important: Uncheck "Skip images with transparency/alpha channel" during export.
    • Photoshop: Use a WebP plugin. Important: Uncheck "Save Metadata" to avoid potential compatibility issues.
    • Command Line: Use the cwebp tool.
    • Web-based: Use Squoosh by Google Chrome Labs.
  10. Follow WhatsApp Brand Guidelines

    main

    When developing and listing your sticker app, adhere to these branding rules:

    • App Naming: Do not use "WhatsApp" in the name of your app or in the name field of your app listing.
    • App Descriptions: You may mention WhatsApp in the app description field when preparing for submission to the Google Play Store or App Store.
    • Brand Formatting: Always use "WhatsApp" as the brand name (capitalized 'W' and 'A', no space between letters).
  11. Test sticker assets with the iOS sample app

    main

    To test your sticker assets using the provided sample app, follow these steps in Xcode:

    1. Open WAStickersThirdParty.xcodeproj in Xcode.
    2. Remove existing sample stickers from the SampleStickers folder.
    3. Drag your sticker images into the SampleStickers folder.
    4. In the file import dialog, ensure "Copy items if needed" and the WAStickersThirdParty target are both checked.
    5. Modify the sticker_packs.wasticker file to reflect your metadata (see Modifying the sticker_packs.wasticker file).
    6. Build and run the app. Note: You must install the app on an actual iPhone to test integration with WhatsApp; the simulator is insufficient for WhatsApp communication.
  12. App Store Submission Guidelines for iOS Sticker Apps

    main

    To comply with Apple's strict App Store review policy, do not submit an app that only exports stickers. Your app must contain more functionality than a simple sticker exporter to increase the chances of acceptance.

    Important: The provided sample iOS app is for API demonstration and testing only. It is not a template for your app and will be rejected by Apple if used as-is. You must develop a unique user interface with your own styling before submitting to the App Store.