InAppNotification
安装
CocoaPods
CocoaPods 是 Cocoa 项目的依赖管理器。您可以使用以下命令安装它
$ gem install cocoapods
要使用 CocoaPods 集成 InAppNotification 到您的 Xcode 项目中,在您的 Podfile
中指定它
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'InsideAppNotification'
end
然后,运行以下命令
$ pod install
使用
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)")
}
)
许可证
InAppNotification 在 MIT 许可下发布。有关详细信息,请参阅 LICENSE