Crasheye.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // [2.7.10]
  2. // Crasheye.h
  3. // Crasheye
  4. //
  5. // Created by PengYuanlong on 16-12-16.
  6. // Copyright (c) 2014年 PengYuanlong. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface Crasheye : NSObject
  10. /*
  11. @brief:通过appKey注册Dump收集
  12. */
  13. +(void) initWithAppKey:(NSString *) appKey;
  14. /*
  15. @brief:通过appKey注册Dump收集,并指定channel
  16. @param:appKey appKey
  17. @param:channel 指定的channel, 由开发都自行填入
  18. */
  19. +(void) initWithAppKey:(NSString *) appKey
  20. withChannel:(NSString *) channel;
  21. /*
  22. @brief:添加自定义数据
  23. */
  24. +(void) addExtraDataWithKey:(NSString *) key withValue:(NSString *) value;
  25. /*
  26. @brief:添加自定义数据
  27. */
  28. +(void) addExtraDataWithDic:(NSDictionary *) dic;
  29. /*
  30. @brief:移除一项自定义数据
  31. */
  32. +(void) removeExtraDataWithKey:(NSString *) key;
  33. /*
  34. @brief:移除所有自定义数据
  35. */
  36. +(void) clearExtraData;
  37. +(void) addLog: (NSString *) log;
  38. +(void) removeLog;
  39. /*
  40. @brief:获取已添加的自定义数据
  41. */
  42. +(NSDictionary *) extraData;
  43. /*
  44. @brief:主动上报脚本异常,可用于lua,js等脚本异常时上报
  45. @param:
  46. errorTitle 错误的标题,由开发人员指定,不可以为空
  47. exception 异常的详细内容 不可以为空
  48. */
  49. +(void) sendScriptExceptionRequestWithTitle:(NSString *) errorTitle exception:(NSString *) exception file:(NSString *) file language:(NSString *) language;
  50. /*
  51. @brief:操作打点, 打点信息会做crash信息一同上报,只保留最后的10个打点信息
  52. */
  53. +(void) leaveBreadcrumb:(NSString *) breadcrumb;
  54. /*
  55. @brief:设置用户ID
  56. */
  57. +(void) setUserID:(NSString *) userID;
  58. +(void) setRegion:(NSString *) region;
  59. /*
  60. @brief:设置App Version,需在init前调用
  61. */
  62. +(void) setAppVersion:(NSString *) appVersion;
  63. /*
  64. @brief:设置用户信息
  65. */
  66. +(void) setUserInfo:(NSDictionary *) userInfo;
  67. /*
  68. @brief:获取Crasheye SDK的版本号
  69. */
  70. +(NSString *) versionForCrasheye;
  71. /*
  72. @brief:获取设备唯一码
  73. */
  74. +(NSString *) getDeviceID;
  75. typedef void (*CrashCallback)(int nSign);
  76. /*
  77. @brief:注册一个回调函数,用于发生Crash的时候,由crasheye通知client
  78. */
  79. +(void) registerCrashCallback:(CrashCallback) callback;
  80. +(void) setFlushOnlyOverWiFi:(int32_t) enabled;
  81. +(void) setBeta:(int32_t) enabled;
  82. +(void) setLogCount: (int32_t) count;
  83. +(void) log:(NSString *) logMsg;
  84. +(void) setURL:(NSString *) serverURL;
  85. @end