Netmera iOS SDK
Netmera iOS SDK,用于 Netmera 移动应用参与平台
了解并理解您的应用用户,向他们发送有针对性的推送通知和弹出广告,并使用 Netmera 分析结果!Netmera iOS SDK 为您提供了一组与 Netmera 用户参与平台无缝工作的工具。有关详细信息,请参阅 https://developer.netmera.com
安装
Netmera 将与最新的公开版本 Swift 兼容。
要求
- iOS 9.0+
- Xcode 11.0+
CocoaPods
pod "Netmera"
为 NotificationServiceExtension
pod "Netmera/NotificationServiceExtension"
为 NotificationContentExtension
pod "Netmera/NotificationContentExtension"
为 不支持 AdId
pod 'Netmera/NetmeraWithoutAdId'
Swift 包管理器(SPM)
在 Xcode 中,选择 文件 > 添加包..
输入此存储库的包 URL https://github.com/Netmera/netmera-ios.git。
Carthage
// TODO: 功能
API
参见 Netmera 的 iOS SDK API
使用说明
开始
在Swift中
import Netmera
didFinishLaunchingWithOptions
在AppDelegate中
Netmera.start()
Netmera.setBaseURL("{BASE_URL}") // Optional
Netmera.setAPIKey("{apiKey}")
Netmera.setAppGroupName("{app.group.name}") // Optional if you want use notification content extension
// Request notifcation authorization.
Netmera.requestPushNotificationAuthorization(forTypes: [.alert, .sound, .badge])
Netmera.setLogLevel(NetmeraLogLevel.debug)
在Objective-c中
#import <Netmera/Netmera.h>
didFinishLaunchingWithOptions
在AppDelegate中
[Netmera setLogLevel:NetmeraLogLevelDebug];
[Netmera start];
[Netmera setAPIKey:@"{API_KEY}"];
[Netmera setBaseURL:@"{BASE_URL}"]; // Optional
[Netmera setAppGroupName:@"app.group.name"]; // Optional if you want use notification content extension
开始/停止数据跟踪
这将会停止/开始所有事件和用户更新请求。
停止
[Netmera stopDataTransfer];
开始
[Netmera startDataTransfer];
用户分类偏好
检索用户的分类偏好。它将返回分类偏好列表。每个分类偏好数据包含id,名称和启用状态。
Netmera.getUserCategoryPreferenceList { categories, error in
if let categories = categories {
print(categories)
} else if let error = error {
print(error)
}
}
管理分类的偏好。要切换给定id的分类偏好状态。
Netmera.setUserCategoryPreferenceWithCategoryId("{categoryId}", categoryEnabled: {true/false}) { error in
...
}
变更日志
查看Netmera的iOS SDK变更日志。
支持
许可协议
Netmera遵循Apache许可证分发。有关详情,请查看LICENSE。