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 和 Carthage 使用。
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 https://developer.netmera.com/en/IOS/Quick-Start
使用方法
开始
在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。