PushNotifications iOS & macOS SDK
示例代码
构建和运行
最低要求
- Xcode - 您可以通过 App Store 获取 Xcode,如果您已经有 Apple Developer 账号的 AppleID,您也可以从 developer.apple.com 下载它。
安装
CocoaPods
CocoaPods 是 Cocoa 项目的一个依赖管理器。您可以使用以下命令进行安装
$ gem install cocoapods
建议使用 CocoaPods 版本 1.3.1 或更高版本来构建 EventflitPushNotifications。
要使用 CocoaPods 将 EventflitPushNotifications 集成到您的 Xcode 项目中,在您的 Podfile
中指定它
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
# Replace `<Your Target Name>` with your app's target name.
target '<Your Target Name>' do
pod 'EventflitPushNotifications'
end
然后,运行以下命令
$ pod install --repo-update
Carthage
Carthage 是一个去中心化的依赖管理器,它会构建您的依赖并为您提供二进制框架。
建议使用 Carthage 版本 0.26.2 或更高版本来构建 EventflitPushNotifications。
您可以使用以下命令使用 Homebrew 安装 Carthage
$ brew update
$ brew install carthage
要使用 Carthage 将 EventflitPushNotifications 集成到您的 Xcode 项目中,在您的 Cartfile
中指定它
github "eventflit/push-notifications-swift"
运行 carthage update
以构建框架,并将构建的 EventflitPushNotifications.framework
拖放到您的 Xcode 项目中。
PushNotifications 参考
- shared - 查看源代码
- start(appId:) - 查看源代码
- registerForRemoteNotifications - 查看源代码
- registerForRemoteNotifications(options:) - 查看源代码
- registerDeviceToken(_:completion:) - 查看源代码
- subscribe(interest:completion:) - 查看源代码
- setSubscriptions(interests:completion:) - 在源中查看
- unsubscribe(interest:completion:) - 在源中查看
- unsubscribeAll(completion:) - 在源中查看
- getInterests() - 在源中查看
- handleNotification(userInfo:) - 在源中查看
通信
- 发现了一个bug?请创建问题。
- 有功能请求吗?请创建问题。
- 如果您想贡献,请提交pull request(最好包含一些测试)。
许可证
EventflitPushNotifications是在MIT许可证下发布的。有关详细信息,请参阅LICENSE。