添加部分通用上报

修改bug 未登录在键盘点击充值要先去跳转登录
This commit is contained in:
2025-12-30 15:27:35 +08:00
parent 34089ddeea
commit 4e2d7d2908
5 changed files with 84 additions and 8 deletions

View File

@@ -13,12 +13,27 @@
#define KB_MAI_POINT_PATH_NEW_ACCOUNT @"/newAccount"
#endif
#ifndef KB_MAI_POINT_PATH_GENERIC_DATA
#define KB_MAI_POINT_PATH_GENERIC_DATA @"/genericData"
#endif
NS_ASSUME_NONNULL_BEGIN
extern NSString * const KBMaiPointErrorDomain;
typedef void (^KBMaiPointReportCompletion)(BOOL success, NSError * _Nullable error);
typedef NS_ENUM(NSInteger, KBMaiPointGenericReportType) {
/// 未知/默认类型(按需扩展,具体含义以服务端约定为准)
KBMaiPointGenericReportTypeUnknown = 0,
/// 点击
KBMaiPointGenericReportTypeClick = 1,
/// 曝光
KBMaiPointGenericReportTypeExposure = 2,
/// 页面/进入
KBMaiPointGenericReportTypePage = 3,
};
/// Lightweight reporter for Mai point tracking. Safe for app + extension.
@interface KBMaiPointReporter : NSObject
@@ -26,9 +41,18 @@ typedef void (^KBMaiPointReportCompletion)(BOOL success, NSError * _Nullable err
/// POST /newAccount with type + account.
- (void)reportNewAccountWithType:(NSString *)type
account:(NSString *)account
account:(nullable NSString *)account
completion:(KBMaiPointReportCompletion _Nullable)completion;
//- (void)reportGenericDataWithEvent:(NSString *)event
// account:(nullable NSString *)account
// completion:(KBMaiPointReportCompletion _Nullable)completion;
/// POST /genericData with type + event + account.
- (void)reportGenericDataWithEventType:(KBMaiPointGenericReportType)type
account:(nullable NSString *)account
completion:(KBMaiPointReportCompletion _Nullable)completion;
/// Generic POST for future endpoints.
- (void)postPath:(NSString *)path
parameters:(NSDictionary *)parameters