Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 1.31 KB

README.md

File metadata and controls

63 lines (45 loc) · 1.31 KB

InAppNotification

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate InAppNotification into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'InsideAppNotification'
end

Then, run the following command:

$ pod install

Usage

import InsideAppNotification
let data: [String: Any] = []

let resource: URL = URL(string: "some_url_here") // You can also put here UIImage or Data that can be converted to UIImage

let notification: InAppNotification = InAppNotification(
	resource: resource,
	title: "Notification title", 
	subtitle: "Notification details", 
	data: data
)

InAppNotificationDispatcher.shared.show(
    notification: notification,
    clickCallback: { (_notification) in
        print("Notification clicked. Data: \(_notification.data)")
    }
)

License

InAppNotification is released under the MIT license. See LICENSE for details.