Stipop SDK provides over 150,000 .png and .gif?raw=true stickers that can be easily integrated into mobile app chats, comment sections, live streams, video calls, etc. Bring fun to your mobile app with stickers loved by millions of users worldwide.
Check Stipop Docs for the comprehensive guide.
Sign up to Stipop Dashboard to download Stipop.plist file.
git clone https://github.com/stipop-development/stipop-ios-sdk
Add Stipop.plist file into the project
Run demo app
Go to File > Swift Packages > Add Package Dependency...
Enter https://github.com/stipop-development/stipop-ios-sdk
. Then select a version you want to use.
If you have a Swift Package, add dependency into Package.swift
dependencies: [
.package(url: "https://github.com/stipop-development/stipop-ios-sdk.git", .upToNextMajor(from: "0.9.8"))
]
Copy & Paste below into Podfile
. Then, run pod install
.
pod 'StipopUIKit', '0.9.8'
import UIKit
import Stipop
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// let semaphore = DispatchSemaphore(value: 1)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// If you want to use SAuth, execute setSAuthDelegate method.
// *setSAuthDelegate() should be typed before initialize()
// Stipop.setSAuthDelegate(sAuthDelegate: self)
Stipop.initialize()
return true
}
...
}
/* If you use SAuth, implement SAuthDelegate and refresh accessToken when authorization error occured. */
/*
extension AppDelegate: SAuthDelegate {
func httpError(apiEnum: SPAPIEnum, error: SPError) {
print("⚡️Stipop: HTTP Error => \(apiEnum)")
DispatchQueue.global().async {
self.semaphore.wait()
DemoSAuthManager.getAccessTokenIfOverExpiryTime(userId: Stipop.getUser().userID, completion: { accessToken in
self.semaphore.signal()
guard let accessToken = accessToken else { return }
Stipop.setAccessToken(accessToken: accessToken)
SAuthManager.reRequest(api: apiEnum)
})
}
}
}
*/
import UIKit
import Stipop
class ViewController: UIViewController {
let stipopButton = SPUIButton(type: .system)
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(stipopButton)
stipopButton.translatesAutoresizingMaskIntoConstraints = false
stipopButton.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
stipopButton.centerYAnchor.constraint(equalTo: view.topAnchor, constant: 150).isActive = true
stipopButton.heightAnchor.constraint(equalToConstant: 25).isActive = true
stipopButton.widthAnchor.constraint(equalToConstant: 25).isActive = true
let user = SPUser(userID: "some_user_id")
stipopButton.setUser(user, viewType: .picker)
stipopButton.delegate = self
}
}
extension ViewController: SPUIDelegate {
func onStickerSingleTapped(_ view: SPUIView, sticker: SPSticker) {
// This function will be executed when user chooses a sticker.
}
/* If you want to use double tap feature, change the plist file and implement this function. */
func onStickerDoubleTapped(_ view: SPUIView, sticker: SPSticker) {
// This function will be executed when user chooses a sticker.
}
}
link |
Stars: 19 |
Last commit: 3 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics