BuglyConfig.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //
  2. // BuglyConfig.h
  3. // Bugly
  4. //
  5. // Copyright (c) 2016年 Tencent. All rights reserved.
  6. //
  7. #pragma once
  8. #define BLY_UNAVAILABLE(x) __attribute__((unavailable(x)))
  9. #if __has_feature(nullability)
  10. #define BLY_NONNULL __nonnull
  11. #define BLY_NULLABLE __nullable
  12. #define BLY_START_NONNULL _Pragma("clang assume_nonnull begin")
  13. #define BLY_END_NONNULL _Pragma("clang assume_nonnull end")
  14. #else
  15. #define BLY_NONNULL
  16. #define BLY_NULLABLE
  17. #define BLY_START_NONNULL
  18. #define BLY_END_NONNULL
  19. #endif
  20. #import <Foundation/Foundation.h>
  21. #import "BuglyLog.h"
  22. BLY_START_NONNULL
  23. @protocol BuglyDelegate <NSObject>
  24. @optional
  25. /**
  26. * 发生异常时回调
  27. *
  28. * @param exception 异常信息
  29. *
  30. * @return 返回需上报记录,随异常上报一起上报
  31. */
  32. - (NSString * BLY_NULLABLE)attachmentForException:(NSException * BLY_NULLABLE)exception;
  33. /**
  34. * 策略激活时回调
  35. *
  36. * @param tacticInfo
  37. *
  38. * @return app是否弹框展示
  39. */
  40. - (BOOL) h5AlertForTactic:(NSDictionary *)tacticInfo;
  41. @end
  42. @interface BuglyConfig : NSObject
  43. /**
  44. * SDK Debug信息开关, 默认关闭
  45. */
  46. @property (nonatomic, assign) BOOL debugMode;
  47. /**
  48. * 设置自定义渠道标识
  49. */
  50. @property (nonatomic, copy) NSString *channel;
  51. /**
  52. * 设置自定义版本号
  53. */
  54. @property (nonatomic, copy) NSString *version;
  55. /**
  56. * 设置自定义设备唯一标识
  57. */
  58. @property (nonatomic, copy) NSString *deviceIdentifier;
  59. /**
  60. * 卡顿监控开关,默认关闭
  61. */
  62. @property (nonatomic) BOOL blockMonitorEnable;
  63. /**
  64. * 卡顿监控判断间隔,单位为秒
  65. */
  66. @property (nonatomic) NSTimeInterval blockMonitorTimeout;
  67. /**
  68. * 设置 App Groups Id (如有使用 Bugly iOS Extension SDK,请设置该值)
  69. */
  70. @property (nonatomic, copy) NSString *applicationGroupIdentifier;
  71. /**
  72. * 进程内还原开关,默认开启
  73. */
  74. @property (nonatomic) BOOL symbolicateInProcessEnable;
  75. /**
  76. * 非正常退出事件记录开关,默认关闭
  77. */
  78. @property (nonatomic) BOOL unexpectedTerminatingDetectionEnable;
  79. /**
  80. * 页面信息记录开关,默认开启
  81. */
  82. @property (nonatomic) BOOL viewControllerTrackingEnable;
  83. /**
  84. * Bugly Delegate
  85. */
  86. @property (nonatomic, assign) id<BuglyDelegate> delegate;
  87. /**
  88. * 控制自定义日志上报,默认值为BuglyLogLevelSilent,即关闭日志记录功能。
  89. * 如果设置为BuglyLogLevelWarn,则在崩溃时会上报Warn、Error接口打印的日志
  90. */
  91. @property (nonatomic, assign) BuglyLogLevel reportLogLevel;
  92. /**
  93. * 崩溃数据过滤器,如果崩溃堆栈的模块名包含过滤器中设置的关键字,则崩溃数据不会进行上报
  94. * 例如,过滤崩溃堆栈中包含搜狗输入法的数据,可以添加过滤器关键字SogouInputIPhone.dylib等
  95. */
  96. @property (nonatomic, copy) NSArray *excludeModuleFilter;
  97. /**
  98. * 控制台日志上报开关,默认开启
  99. */
  100. @property (nonatomic, assign) BOOL consolelogEnable;
  101. /**
  102. * 崩溃退出超时,如果监听到崩溃后,App一直没有退出,则到达超时时间后会自动abort进程退出
  103. * 默认值 5s, 单位 秒
  104. * 当赋值为0时,则不会自动abort进程退出
  105. */
  106. @property (nonatomic, assign) NSUInteger crashAbortTimeout;
  107. /**
  108. * 设置自定义联网、crash上报域名
  109. */
  110. @property (nonatomic, copy) NSString *crashServerUrl;
  111. @end
  112. BLY_END_NONNULL