The Wraper around Apple push notification.
Just add PushManager.swift
into your awesome project.
// Use UIApplication's shared object `application`
PushManager.shared.set(pushFor: application) { (isGranted, token, error) in
if error == nil {
//Error while registering device
print("Error :- \(String(describing: error?.localizedDescription))")
return
}
print("Device Token :- \(String(describing: token!)) and Permission :- \(String(describing: isgranted!))")
}
if let token = PushManager.shared.deviceToken {
print(token)
}
let permition = PushManager.shared.isPermitionGranted
print("Push notification :\(permition)")
// You can subscribe at any place using....
PushManager.shared.manager.subscribe { notificationData in
print("Notification Data - \(notificationData)")
}
Feel free to submit issues and enhancement requests.
Please refer to each project's style guidelines and guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
This project is licensed under the MIT License - see the LICENSE.md file for details
- Hat tip to anyone whose code was used
- Inspiration
- etc
- 🍺