SendMan
SendMan 是一款为移动应用提供的推送通知管理服务。此 SDK 允许您将原生 iOS 应用与 SendMan 集成。
安装
SendMan 通过 CocoaPods 或 Carthage 提供。
CocoaPods
为了通过 CocoaPods 安装,请将以下行添加到您的 Podfile 中
pod 'SendMan', '~> 1.0.0'
Carthage
为了通过 Carthage 安装,请将以下行添加到您的 Cartfile 中,并像添加其他 Carthage 依赖项一样安装
github "sendmanio/sendman-ios-sdk" ~> 1.0.0
集成
先决条件
- SendMan支持iOS >= 10.0作为部署目标。
- 您的应用必须配置以下功能
- 推送通知
- 后台模式:远程通知
步骤
-
初始化SDK(从API密钥页面获取您的应用密钥和密钥)
// Step 1: App-level identification: Initialize our SDK. SendMan.setAppConfig(SMConfig(key: YOUR_APP_KEY, andSecret: YOUR_APP_SECRET)!) // Step 2: User-level identification: Identify your users with the unique ID your application uses to identify users. SendMan.setUserId("some-unique-id")
如果您的用户没有唯一的ID,请使用此语法,让我们自动为您处理这些用户
SendMan.setAppConfig(SMConfig(key: YOUR_APP_KEY, andSecret: YOUR_APP_SECRET, autoGenerateUsers: true)!)
-
在iOS上注册推送通知
SendMan.requestPushAuthorization()
有关详细集成指南(包括使用Objective-C集成、跟踪用户与通知的交互以及存储自定义用户属性),请参阅我们的文档。
作者
SendMan,[email protected]
许可
SendMan遵循MIT许可证。更多信息请参阅LICENSE文件。