Swiftpack.co - Package - fumito-ito/SwiftyInAppMessaging
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.


The easiest way to coexist your customized view and InAppMessaging default view.

HEADS UP!! This library is under construction

SwiftyInAppMessaging is not supporting Banner type messaging. Please construct your original alert or contribute to me :heart: .


There is only one step to start using SwiftyInAppMessaging.

func application(_ application: UIApplication, didFinishLaunchWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  InAppMessaging.inAppMessaging().messageDisplayComponent = SwiftyInAppMessaging()


Define your message handler

struct InAppMyModalMessageHandler: InAppModalMessageHandler {
    let messageForDisplay: InAppMessagingModalDisplay
    let displayDelegate: InAppMessagingDisplayDelegate

    init?(message messageForDisplay: InAppMessagingDisplayMessage, displayDelegate: InAppMessagingDisplayDelegate) {
        guard let messageForDisplay = messageForDisplay as? InAppMessagingModalDisplay else {
            return nil

        self.messageForDisplay = messageForDisplay
        self.displayDelegate = displayDelegate

    static func canHandleMessage(message messageForDisplay: InAppMessagingDisplayMessage, displayDelegate: InAppMessagingDisplayDelegate) -> Bool {
        return messageForDisplay is InAppMessagingModalDisplay

    func displayMessage() {
        let alert = UIAlertController(title: self.messageForDisplay.title)
        let ok = UIAlertAction(title: "OK", style: .default, handler: { _ in })


        DispatchQueue.main.async {
            UIApplication.shared.topViewController?.present(alert, animated: true, completion: nil)

    func displayError(_ error: Error) {

Define your configuration

struct MyInAppMessagingConfiguration: SwiftyInAppMessagingConfiguration {
    let useDefaultHandlersIfNeeded: Bool = true
    let messageHandlers: [InAppMessageHandler.Type] = [

Pass handlers through configuration

func application(_ application: UIApplication, didFinishLaunchWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  let config = MyInAppMessagingConfiguration()
  InAppMessaging.inAppMessaging().messageDisplayComponent = SwiftyInAppMessaging(with: config)


  • Firebase iOS SDK == 7.3.0



Just add your Cartfile

github "fumito-ito/SwiftyInAppMessaging" ~> 0.0.1

:bangbang: firebase ios sdk announces to discontinue carthage support. if firebase-ios-sdk stops supporting carthage, this library will follow.

Swift Package Manager

Just add to your Package.swift under dependencies

let package = Package(
    name: "MyPackage",
    products: [...],
    dependencies: [
        .package(url: "https://github.com/fumito-ito/SwiftyInAppMessaging.git", .upToNextMajor(from: "0.0.1"))

firebase ios sdk supports Swift Package Manager in Beta. If you have some issues caused in Swift Package Manager, Please check firebase issues.


SwiftyInAppMessaging is available under the Apache License 2.0. See the LICENSE file for more detail.


Stars: 0