立即注册 登录
即时通讯网 返回首页

Ryun的个人空间 http://www.52im.net/?28523 [收藏] [复制] [RSS]

日志

如何统计 Push 消息的打开率?

已有 205 次阅读2023-10-18 15:26 |个人分类: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];
...
}"

0 推荐

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

返回顶部