
IM即时通讯
安全可靠、全球互通

实时音视频
流畅稳定、省钱省力
回答:
2.3.1 及以上版本支持系统消息推送的点击统计,您可以通过 SDK 提供的 API 统计打开的消息和点击的时间。
在您的 AppDelegate 代码中调用 SDK push 统计 API。
请根据当前的 SDK 确定调用具体的接口
RCIMClient 和 RCCoreClient 两个类的接口是互斥的,不能同时调用两个类的接口,否则会出现重复统计
1、在 app 启动和 SDK init 之后,调用 recordLaunchOptionsEvent 接口
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... //初始化融云SDK [[RCIM sharedRCIM] initWithAppKey:RONGCLOUD_IM_APPKEY]; ... /** * 统计Push打开率1。 */ //2.x 或 4.x 版本调用下面接口 [[RCIMClient sharedRCIMClient] recordLaunchOptionsEvent:launchOptions]; //5.x 版本调用下面接口 [[RCCoreClient sharedCoreClient] recordLaunchOptionsEvent:launchOptions]; ... }
2、收到本地通知后调用 recordLocalNotificationEvent 接口
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { ... /** * 统计Push打开率2 */ //2.x 或 4.x 调用下面接口 [[RCIMClient sharedRCIMClient] recordLocalNotificationEvent:notification]; //5.x 调用下面接口 [[RCCoreClient sharedCoreClient] recordLocalNotificationEvent:notification]; ... }
3、收到远程推送后调用 recordRemoteNotificationEvent 接口
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { ... /** * 统计Push打开率3 */ //2.x 或 4.x 版本调用下面接口 [[RCIMClient sharedRCIMClient] recordRemoteNotificationEvent:userInfo]; //5.x 版本调用下面接口 [[RCCoreClient sharedCoreClient] recordRemoteNotificationEvent:userInfo]; ... }