TechMpire nxus 平台 SDK CocoaPods 分发,适用于 iOS 开发者
nxus_ios_cocoapod 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中
(省略部分内容)
pod "nxus_ios_cocoapod"
完成前面步骤后,您就可以初始化库并开始发送事件。
打开 AppDelegate.m 类并导入库的头文件
#import "include/NxusDSP/NxusDSP.h"
然后,在 AppDelegate 的 didFinishLaunchingWithOptions 方法中初始化它
[NxusDSP initializeLibrary:@"YOUR_API_KEY"];
您可以通过调用 trackEvent 方法发送自定义事件
[NxusDSP trackEvent:@"event-name"];
如果您想发送其他额外的参数,传递一个 NSMutableDictionary 实例
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
[params setValue:@"value" forKey:@"key"];
[NxusDSP trackEvent:event params:params];
要在库初始化之前启用日志记录功能,调用初始化前的 debuggingEnabled 方法
[NxusDSP debuggingEnabled:YES];
TechMpire ltd.
nxus_ios_cocoapod 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。