Package Exports
- ry-notification-center
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ry-notification-center) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
RYNotificationCenter
Implement NotificationCenter design mode from Objective-C/Swift with typescript.
Manage multiple event emiters with singleton NotificationCenter to simplify notification push/observe logic.
Install with npm
npm install ry-notification-center@latestHow to use
//Add observer in page/component/plugin init method
ionViewDidLoad() {
RYNotificationCenter.default.addObserver(this, "NotificationKey", (notification) => {
// callback when received notification
})
}
//Remove observer in page/component/plugin dealloc method
ionViewWillUnload() {
RYNotificationCenter.default.removeObserver(this)
}