EZPush

1.4.3

ez-push/ios

What's New

Release 1.4.3

2024-05-28T11:55:39Z

Full Changelog: 1.4.2...1.4.3

EZPush SDK

Menu

Requirements

Swift 5 iOS 13.0+

Documentation

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate EZPush into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!

target '<Your Target Name>' do
    platform :ios, '13.0'
    pod 'EZPush'
end

Then, run the following command:

$ pod install

Swift Package Manager

You can use the Swift Package Manager to install EZPush into your Xcode project. Follow these steps:

  1. Open your project in Xcode.
  2. Select "File" -> "Swift Packages" -> "Add Package Dependencies..."
  3. Enter the URL of this repository: https://github.com/ez-push/ios
  4. Select the version you'd like to use and click "Add Package".

Usage

Setup App Delegate

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
    application.registerForRemoteNotifications()
    EZPush.current.registerPushNotificationDelegate() // EZPush must handle incoming notifications
    return true
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    // TODO: store device token for EZ-Push initialization
}

To get started with EZPush, import the module into your Swift code:

import EZPush

Request for Permission

EZPush.current.requestForPushNotificationPermission([.alert, .badge, .sound]) { _, _ in }

Configure EZPush

let config = EZPushConfiguration(licenseKey: "YOUR_LICENSE_KEY", showDebugInfo: true, groupName: "YOUR_GROUP_NAME")
EZPush.current.configure(config)
EZPush.current.initialize(pushNotificationToken: "PUSH_NOTIFICATION_TOKEN") { _, _ in }

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

  • None
Last updated: Tue May 28 2024 12:28:45 GMT-0900 (Hawaii-Aleutian Daylight Time)