BuryPoint.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //
  2. // BuryPoint.h
  3. // BuryPoint
  4. //
  5. // Created by Felix on 2018/8/10.
  6. // Copyright © 2018年 Felix. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "VclLog.h"
  10. #import "HWBuryPointModel.h"
  11. #ifdef Debug
  12. #define VclWrite(content) [[BuryPoint sharedInstance] writeContent:content]
  13. #else
  14. #define VclWrite(...)
  15. #endif
  16. /**
  17. 1.当应用程序崩溃时,BuryPoint会保存本次奔溃的信息到~/Library/Caches/BuryPoint/JoyLite/Reports/...目录下;
  18. 2.应用程序每次的启动,都会新创建一个文件,用于记录用户本次的操作、或者崩溃信息,命名如:log_2018.08.14.18_46_19.0190_ios.txt;
  19. 3.规定单个文件不能超过1024KB,当超过1024KB时应需要新建文件;
  20. 4.应用程序每次启动,都会检查除本次启动新建的文件外的所有日志文件名称,而且需要上传这些文件,根据上传返回的结果,上传成功的需要在本地删除掉
  21. 未上传成功的,暂不删除,待下次启动时再做上传处理。
  22. */
  23. // 定义一个BuriedPointType的字符串类型作为枚举类型
  24. typedef NSString *BuriedPointType NS_STRING_ENUM;
  25. // 声明以下埋点类型BuriedPointType枚举值
  26. // 云手机
  27. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeCloudPhone;
  28. // 云盘
  29. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeCloudStore;
  30. // 福利社区
  31. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeWelfare;
  32. // 云游戏
  33. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeCloudGame;
  34. // 我的
  35. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeMime;
  36. // 裂变活动-免费领机
  37. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeReceivePhone;
  38. // 支付结果页面进入周年庆活动
  39. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePaySuccessEnter;
  40. // 周年庆活动-分配确认
  41. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeClickDistribute;
  42. // 周年庆活动-分配确认 弹窗确认
  43. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeSureDistribute;
  44. // 周年庆活动-分配确认 弹窗取消
  45. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeCancelDistribute;
  46. // 周年庆活动-未分配返回
  47. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeDistributeBack;
  48. // 快捷方式创建埋点
  49. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeShortcutCreat;
  50. // 快捷方式打开埋点
  51. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypeShortcutOpen;
  52. // 云手机试用续费弹窗
  53. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeForceCloseBuy;//@"激活码-强制关闭-去购买";
  54. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeForceCloseCancel;// @"激活码-强制关闭-取消";
  55. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeForceCloseGiveUp;// @"激活码-强制关闭-放弃";
  56. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeForceCloseContinue;// @"激活码-强制关闭-继续观看";
  57. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeCloseBuy;// @"激活码-关闭-去购买";
  58. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeCloseCancel;// @"激活码-关闭-取消";
  59. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeBreakBuy;// @"激活码-断线-去购买";
  60. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayActCodeBreakCancel;// @"激活码-断线-取消";
  61. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayFreeForceCloseBuy;// @"免费试用-强制关闭-去购买";
  62. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayFreeForceCloseCancel;// @"免费试用-强制关闭-取消";
  63. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayFreeForceCloseGiveUp;// @"免费试用-强制关闭-放弃";
  64. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayFreeForceCloseContinue;// @"免费试用-强制关闭-继续观看";
  65. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayFreeCloseBuy;// @"免费试用-关闭-去购买";
  66. FOUNDATION_EXPORT BuriedPointType const BuriedPointTypePlayFreeCloseCancel;// @"免费试用-关闭-取消";
  67. @interface BuryPoint : NSObject <NSCopying>
  68. + (instancetype)sharedInstance;
  69. /// 向buryPoint.txt文件写入content信息,会自动换行
  70. - (void)writeContent:(NSString *)content;
  71. + (void)reportBuriedPointWithType:(NSString *)type;
  72. /**试用广告埋点*/
  73. + (void)reportTrialADPointWithPhoneID:(NSString *)phoneID;
  74. #pragma mark - 全新埋点 7.1
  75. /** 保存或更新埋点数组缓存数据 */
  76. + (void)saveHWBuryPointModelListWithModel:(HWBuryPointModel *)model;
  77. /** 读取埋点数组缓存数据 */
  78. + (NSMutableArray *)readHWBuryPointModelList;
  79. /** 清空埋点数组缓存数据 */
  80. + (void)clearHWBuryPointModelList;
  81. /** 实时上报埋点数据 */
  82. + (void)updateBuryPointModelListWithModel:(HWBuryPointModel *)model;
  83. @end