CocoaPods trunk is moving to be read-only. Read more on the blog, there are 13 months to go.
| TestsTested | ✗ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Mar 2017 |
| SwiftSwift Version | 3.0 |
| SPMSupports SPM | ✗ |
Maintained by kunass2.
To run the example project, clone the repo, and run pod install from the Example directory first.
ForegroundNotification is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BSForegroundNotification"If you used use_framework in your podfile just simply do:
import ForegroundNotification
for every file when you need to use it.
you may also use:
@import ForegroundNotification
within bridging header file and avoid to import framework for every needed file.
alertTitle and alertBody cannot be niltitle and body cannot be nil in alert dictionary. In case when alert is a string, that string cannot be empty.let notification = ForegroundNotification(userInfo: userInfo) //remote
let notification = ForegroundNotification(localNotification: localNotification) //local
let notification = ForegroundNotification(titleLabel: "title", subtitleLabel: "subtitle", categoryIdentifier: "category") //custom initializerForegroundNotification.timeToDismissNotification = 4
ForegroundNotification.systemSoundID: SystemSoundID = 1001BSForegroundNotificationDelegate:Note that ForegroundNotificationDelegate inherits from UIApplicationsDelegate
notification.delegate = selfForegroundNotificationDelegate @objc public protocol ForegroundNotificationDelegate: class, UIApplicationDelegate {
optional func foregroundRemoteNotificationWasTouched(with userInfo: [AnyHashable: Any])
optional func foregroundLocalNotificationWasTouched(with localNotification: UILocalNotification)
}notification.presentNotification()ForegroundNotificationDelegate’s method is called’:func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable: Any], completionHandler: () -> Void)
func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [AnyHashable: Any], withResponseInfo responseInfo: [AnyHashable: Any], completionHandler: () -> Void)
func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void)
func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, withResponseInfo responseInfo: [AnyHashable: Any], completionHandler: () -> Void)Bartłomiej Semańczyk, [email protected]
BSForegroundNotification is available under the MIT license. See the LICENSE file for more info.