TelegramStickersImport helps your users import third-party programaticaly created sticker sets into Telegram Messenger for iOS.
Please read the full documentation here: https://core.telegram.org/import-stickers
WARNING: Each time a user imports stickers, a new sticker pack is created on Telegram. Do not use the importing feature to share stickers you made with other users. If you want to share your stickers, simply upload them using @stickers, then share the link of your pack. For example, here's a link to install some Duck Stickers.
To install TelegramStickersImport via Cocoapods add the following to your Podfile:
target 'MyApp' do
pod 'TelegramStickersImport'
end
then run pod install
in your project root directory.
Add the following line to your Cartfile:
github "telegrammessenger/TelegramStickersImport"
then run carthage update
, and you will get the latest version of TelegramStickersImport in your Carthage folder.
Go to File > Swift Packages > Add Package Dependency... in Xcode and search for TelegramStickersImport
.
Configure your Info.plist
by right-clicking it in Project Navigator, choosing Open As > Source Code and adding this snippet:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>tg</string>
</array>
To import a sticker set of a single sticker to Telegram, add the following code to your app:
import TelegramStickersImport
let stickerSet = StickerSet(software: "Example Software", type: .image)
let yourStickerImage = UIImage()
if let stickerData = Sticker.StickerData(image: yourStickerImage) {
try? stickerSet.addSticker(data: stickerData, emojis: ["😎"])
}
try? stickerSet.import()
TelegramStickersImport is available under the MIT license. See the LICENSE file for more info.