Welcome to the documentation for NWPusher, a powerful push notification framework for iOS.
About NWPusher
NWPusher is a comprehensive push notification framework designed specifically for iOS applications. It provides developers with an easy-to-use interface to integrate push notifications seamlessly into their apps.
Features
- Easy integration with existing iOS projects
- Support for both local and remote push notifications
- Ability to handle different notification types (alert, badge, sound)
- Support for silent push notifications
- Customizable UI and notification handling logic
- In-app notifications for better user engagement
- Rich media support for images and videos in notifications
- Support for background fetch and background processing of notifications
Installation
Follow the steps below to install NWPusher into your iOS project.
Requirements
- iOS 10.0 or later
- Xcode 11.0 or later
Installation Steps
1. Open Terminal and navigate to the root directory of your project.
2. Run the following command to install NWPusher using CocoaPods:
pod 'NWPusher'
3. Open your project workspace in Xcode.
4. Import the NWPusher module into the appropriate files:
import NWPusher
5. Build and run your project. NWPusher is now successfully installed.
Usage
To start using NWPusher in your iOS project, follow the steps below:
Configuration
1. Import the NWPConfiguration module into the appropriate file:
import NWPNotificationConfiguration
2. Initialize the notification configuration with your app’s settings:
let config = NWPNotificationConfiguration(appId: "YOUR_APP_ID", appKey: "YOUR_APP_KEY", isProduction: true)
3. Set the notification configuration:
NWPNotificationManager.shared.setConfiguration(config)
Push Notifications
1. Request user permission to receive push notifications:
NWPNotificationManager.shared.requestAuthorization { (authorized, error) in // Handle authorization response }
2. Register the app for receiving push notifications:
NWPNotificationManager.shared.registerForRemoteNotifications()
Handling Notifications
You can handle push notifications using the methods provided by NWPNotificationDelegate. Implement the delegate methods in the appropriate file:
import NWPNotificationDelegate
Implement the following delegate methods:
extension AppDelegate: NWPNotificationDelegate { func didRegisterForRemoteNotifications(withDeviceToken deviceToken: Data) { // Handle device token registration } func didFailToRegisterForRemoteNotificationsWithError(_ error: Error) { // Handle failed registration } func didReceiveRemoteNotification(with userInfo: [AnyHashable : Any]) { // Handle received remote notification } }
API Reference
For detailed information on NWPusher’s classes and methods, refer to the API Reference.
Example Projects
Check out the example projects on GitHub to see how NWPusher can be used in real-world scenarios:
Example Project 1 – Simple Notification
Link to GitHub Repo: https://github.com/your_username/example_project_1
A simple iOS project demonstrating the basic implementation of push notifications using NWPusher.
Example Project 2 – In-App Notifications
Link to GitHub Repo: https://github.com/your_username/example_project_2
An iOS project showcasing the use of in-app notifications with NWPusher, allowing for better user engagement.
Support
For any issues or inquiries, please contact our support team at support@nwpusher.com.