With a help of ChatGPT I'm trying to create an iOS Sticker App for WhatsApp based in this link:
github.com
The project (so far) is in attach.
I'm using the Hosted Builder and I get this error:
error: 'StickerPackManager.h' file not found
The actual file is "StickerPackManager.swift"
How can I proceed with this project?
Thanks in advance for any tips.
stickers/iOS at main · WhatsApp/stickers
This repository contains the iOS and Android sample apps and API for creating third party sticker packs for WhatsApp. - WhatsApp/stickers
The project (so far) is in attach.
I'm using the Hosted Builder and I get this error:
error: 'StickerPackManager.h' file not found
The actual file is "StickerPackManager.swift"
How can I proceed with this project?
Thanks in advance for any tips.
1. Practical path (what you need to do)
1.1. Prepare the assets and the sticker_packs.wasticker file
This part is identical to the official iOS sample:
1.2. Integrate the WhatsApp sample project into the Xcode project generated by B4i
Typical workflow:
'<array>
'<string>whatsapp</string>
'</array>
#QueriesSchemes: whatsapp
This allows the app to open the whatsapp:// URL scheme on iOS.
1.3. Create an Objective-C wrapper usable from B4i
In B4i, you can embed inline Objective-C code using #If OBJC.
Your goal is to expose a simple method that invokes the same logic used by the “Add to WhatsApp” button in the official iOS sample.
Example:
B4i side:
Objective-C wrapper inside the same B4i module:
The main implementation inside addStickerPackToWhatsApp must be copied from the original Sample Project, since that’s the code that builds and validates the sticker pack and triggers WhatsApp import.
1.1. Prepare the assets and the sticker_packs.wasticker file
This part is identical to the official iOS sample:
- Follow the official image rules (512×512, <100 KB, 3–30 stickers, 96×96 tray icon).
- Create the sticker_packs.wasticker file (a JSON-based metadata file) containing:
- identifier (the pack ID),
- name,
- publisher,
- tray_image_file,
- list of image_file items.
1.2. Integrate the WhatsApp sample project into the Xcode project generated by B4i
Typical workflow:
- In B4i, generate a Release build and download the app’s Xcode project.
- Open the generated Xcode project.
- Inside Xcode, add the folders/classes from the WAStickersThirdParty iOS sample (or at least the core files such as Sticker.swift, StickerPack.swift, StickerPackManager, etc.).
- Copy the following into your app bundle:
- all sticker images,
- the sticker_packs.wasticker file.
- In your Info.plist, add:
'<array>
'<string>whatsapp</string>
'</array>
#QueriesSchemes: whatsapp
This allows the app to open the whatsapp:// URL scheme on iOS.
1.3. Create an Objective-C wrapper usable from B4i
In B4i, you can embed inline Objective-C code using #If OBJC.
Your goal is to expose a simple method that invokes the same logic used by the “Add to WhatsApp” button in the official iOS sample.
Example:
B4i side:
B4X:
Sub AddStickerPackToWhatsApp (Identifier As String, Name As String)
Dim no As NativeObject = Me
no.RunMethod("addStickerPackToWhatsApp::", Array(Identifier, Name))
End Sub
Sub btnAdd_Click
Dim packId As String = "my_pack_01"
Dim packName As String = "Cuppy Stickers"
AddStickerPackToWhatsApp(packId, packName)
End Sub
Objective-C wrapper inside the same B4i module:
B4X:
#If OBJC
#import "StickerPackManager.h" // or the equivalent header from WAStickersThirdParty
- (void)addStickerPackToWhatsApp:(NSString *)identifier :(NSString *)name {
// You will copy/adapt this code from the official iOS sample.
// Example logic:
//
// StickerPack *pack = [StickerPackManager stickerPackWithIdentifier:identifier];
// if (pack) {
// [StickerPackManager addStickerPackToWhatsApp:pack
// completionHandler:^(BOOL success, NSError *error) {
// // Optional: handle callback
// }];
// }
}
#End If
The main implementation inside addStickerPackToWhatsApp must be copied from the original Sample Project, since that’s the code that builds and validates the sticker pack and triggers WhatsApp import.
Attachments
Last edited: