添加埋点
This commit is contained in:
@@ -181,11 +181,21 @@
|
||||
|
||||
/// 点击第一条示例文案
|
||||
- (void)kb_onTapQ1 {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_guide_copy_example_1"
|
||||
pageId:@"guide"
|
||||
elementId:@"copy_example_1"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self kb_copyTextToPasteboard:[self.q1Button titleForState:UIControlStateNormal]];
|
||||
}
|
||||
|
||||
/// 点击第二条示例文案
|
||||
- (void)kb_onTapQ2 {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_guide_copy_example_2"
|
||||
pageId:@"guide"
|
||||
elementId:@"copy_example_2"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self kb_copyTextToPasteboard:[self.q2Button titleForState:UIControlStateNormal]];
|
||||
}
|
||||
|
||||
|
||||
@@ -164,6 +164,11 @@
|
||||
#pragma mark - Actions
|
||||
- (void)onTapBuyAction {
|
||||
// if (self.onTapBuy) { self.onTapBuy(); }
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_home_buy_vip_btn"
|
||||
pageId:@"home_main"
|
||||
elementId:@"buy_vip_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
// 未登录时先跳到登录页;登录后才允许进入会员购买页
|
||||
if (![KBUserSessionManager shared].isLoggedIn) {
|
||||
[[KBUserSessionManager shared] goLoginVC];
|
||||
|
||||
@@ -48,15 +48,15 @@
|
||||
|
||||
KBWeakSelf
|
||||
self.keyPermissButton.clickDragViewBlock = ^(WMDragView *dragView){
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_home_permission_float_btn"
|
||||
pageId:@"home_main"
|
||||
elementId:@"permission_float_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
KBGuideVC *vc = [KBGuideVC new];
|
||||
[weakSelf.navigationController pushViewController:vc animated:true];
|
||||
};
|
||||
|
||||
|
||||
[[KBMaiPointReporter sharedReporter] reportGenericDataWithEventType:KBMaiPointGenericReportTypePage account:@"123" completion:^(BOOL success, NSError * _Nullable error) {
|
||||
NSLog(@"===");
|
||||
}];
|
||||
|
||||
|
||||
// 测试groups
|
||||
// NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:AppGroup];
|
||||
// // 写入一个简单字符串
|
||||
|
||||
@@ -226,6 +226,11 @@
|
||||
KBLOG(@"KBEmailLoginVC onTapSubmit, email=%@, pwdLen=%zd",
|
||||
self.emailTextField.text,
|
||||
self.passwordTextField.text.length);
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_login_email_submit_btn"
|
||||
pageId:@"login_email"
|
||||
elementId:@"submit_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
NSString *email = self.emailTextField.text ? self.emailTextField.text : @"";
|
||||
NSString *password = self.passwordTextField.text ? self.passwordTextField.text : @"";
|
||||
KBWeakSelf;
|
||||
|
||||
@@ -265,6 +265,12 @@
|
||||
NSString *pwd = self.passwordTextField.text ?: @"";
|
||||
NSString *repeat = self.repeatPasswordTextField.text ?: @"";
|
||||
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_register_email_submit_btn"
|
||||
pageId:@"register_email"
|
||||
elementId:@"submit_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
|
||||
if (email.length == 0 || pwd.length == 0 || repeat.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Please complete all fields")];
|
||||
return;
|
||||
|
||||
@@ -113,6 +113,12 @@
|
||||
- (void)onTapNext {
|
||||
NSString *pwd = self.passwordTextField.text ?: @"";
|
||||
NSString *repeat = self.repeatPasswordTextField.text ?: @"";
|
||||
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_forgot_newpwd_next_btn"
|
||||
pageId:@"forgot_password_newpwd"
|
||||
elementId:@"next_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
|
||||
if (pwd.length == 0 || repeat.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Please complete all fields")];
|
||||
|
||||
@@ -66,6 +66,11 @@
|
||||
- (void)onTapNext {
|
||||
NSString *email = [self.emailTextField.text ?: @"" stringByTrimmingCharactersInSet:
|
||||
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_forgot_email_next_btn"
|
||||
pageId:@"forgot_password_email"
|
||||
elementId:@"next_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
if (email.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Enter Email Address")];
|
||||
return;
|
||||
|
||||
@@ -76,6 +76,11 @@
|
||||
|
||||
- (void)onTapNext {
|
||||
NSString *code = self.codeInputView.textValue ?: @"";
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_forgot_verify_next_btn"
|
||||
pageId:@"forgot_password_verify"
|
||||
elementId:@"next_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
if (code.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Enter Email Verification Code")];
|
||||
return;
|
||||
|
||||
@@ -169,6 +169,11 @@
|
||||
|
||||
- (void)onTapAppleLogin {
|
||||
KBLOG(@"onTapAppleLogin");
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_login_apple_btn"
|
||||
pageId:@"login"
|
||||
elementId:@"apple_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[[KBLoginVM shared] signInWithAppleFromViewController:KB_CURRENT_NAV completion:^(BOOL success, NSError * _Nullable error) {
|
||||
if (success) {
|
||||
[KBHUD showInfo:KBLocalized(@"Signed in successfully")];
|
||||
@@ -190,6 +195,11 @@
|
||||
- (void)onTapEmailLogin {
|
||||
// 后续接入邮箱登录逻辑
|
||||
KBLOG(@"onTapEmailLogin");
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_login_email_btn"
|
||||
pageId:@"login"
|
||||
elementId:@"email_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
KBEmailLoginVC *vc = [[KBEmailLoginVC alloc] init];
|
||||
UINavigationController *nav = KB_CURRENT_NAV;
|
||||
if ([nav isKindOfClass:[BaseNavigationController class]]) {
|
||||
@@ -207,6 +217,11 @@
|
||||
- (void)onTapSignUp {
|
||||
// 打开注册页
|
||||
KBLOG(@"onTapSignUp");
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_login_signup_btn"
|
||||
pageId:@"login"
|
||||
elementId:@"signup_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
KBEmailRegistVC *vc = [[KBEmailRegistVC alloc] init];
|
||||
UINavigationController *nav = KB_CURRENT_NAV;
|
||||
if ([nav isKindOfClass:[BaseNavigationController class]]) {
|
||||
@@ -219,6 +234,11 @@
|
||||
- (void)onTapForgotPassword {
|
||||
// 打开忘记密码页
|
||||
KBLOG(@"onTapForgotPassword");
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_login_forgot_btn"
|
||||
pageId:@"login"
|
||||
elementId:@"forgot_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
KBForgetPwdVC *vc = [[KBForgetPwdVC alloc] init];
|
||||
UINavigationController *nav = KB_CURRENT_NAV;
|
||||
if ([nav isKindOfClass:[BaseNavigationController class]]) {
|
||||
|
||||
@@ -89,6 +89,11 @@
|
||||
|
||||
- (void)onTapConfirm {
|
||||
NSString *code = self.codeInputView.textValue ?: @"";
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_register_verify_confirm_btn"
|
||||
pageId:@"register_verify_email"
|
||||
elementId:@"confirm_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
if (code.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Enter Email Verification Code")];
|
||||
return;
|
||||
|
||||
@@ -90,6 +90,12 @@
|
||||
[KBHUD showInfo:KBLocalized(@"Please Enter The Content")];
|
||||
return;
|
||||
}
|
||||
NSDictionary *extra = @{@"content_len": @(content.length)};
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_feedback_commit_btn"
|
||||
pageId:@"feedback"
|
||||
elementId:@"commit_btn"
|
||||
extra:extra
|
||||
completion:nil];
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[self.viewModel submitFeedbackWithContent:content completion:^(BOOL success, NSError * _Nullable error) {
|
||||
if (!success) { return; }
|
||||
|
||||
@@ -257,6 +257,11 @@ static NSString * const kKBMyKeyboardCellId = @"kKBMyKeyboardCellId";
|
||||
|
||||
- (void)onSave {
|
||||
// 点击底部保存按钮时,调用更新用户人设排序接口
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_my_keyboard_save_btn"
|
||||
pageId:@"my_keyboard"
|
||||
elementId:@"save_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self kb_updateUserCharacterSortWithShowHUD:YES];
|
||||
}
|
||||
|
||||
|
||||
@@ -257,9 +257,21 @@
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (void)onTapAvatarEdit { [self presentImagePicker]; }
|
||||
- (void)onTapAvatarEdit {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_person_avatar_edit"
|
||||
pageId:@"person_info"
|
||||
elementId:@"avatar_edit"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self presentImagePicker];
|
||||
}
|
||||
|
||||
- (void)onTapLogout {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_person_logout_btn"
|
||||
pageId:@"person_info"
|
||||
elementId:@"logout_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self.myVM logout];
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,13 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
- (void)onToggleEdit {
|
||||
self.editingMode = !self.editingMode;
|
||||
|
||||
NSDictionary *extra = @{@"editing": @(self.isEditingMode)};
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_my_skin_toggle_edit"
|
||||
pageId:@"my_skin"
|
||||
elementId:@"toggle_edit"
|
||||
extra:extra
|
||||
completion:nil];
|
||||
|
||||
// 更新顶部按钮
|
||||
[self.kb_rightButton setTitle:(self.isEditingMode ? KBLocalized(@"Cancel") : KBLocalized(@"Editor"))
|
||||
forState:UIControlStateNormal];
|
||||
@@ -154,6 +161,13 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
NSArray<NSIndexPath *> *selectedIndexPaths = [[self.collectionView indexPathsForSelectedItems] sortedArrayUsingSelector:@selector(compare:)];
|
||||
if (selectedIndexPaths.count == 0) return;
|
||||
|
||||
NSDictionary *preExtra = @{@"selected_count": @(selectedIndexPaths.count)};
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_my_skin_delete_btn"
|
||||
pageId:@"my_skin"
|
||||
elementId:@"delete_btn"
|
||||
extra:preExtra
|
||||
completion:nil];
|
||||
|
||||
NSMutableArray<NSString *> *themeIds = [NSMutableArray arrayWithCapacity:selectedIndexPaths.count];
|
||||
for (NSIndexPath *ip in selectedIndexPaths) {
|
||||
if (ip.item >= self.data.count) { continue; }
|
||||
@@ -245,6 +259,16 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
// 非编辑态:可在此进入详情,当前示例不处理
|
||||
KBMyTheme *theme = self.data[indexPath.item];
|
||||
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
if ([theme.themeId isKindOfClass:NSString.class] && theme.themeId.length > 0) {
|
||||
extra[@"theme_id"] = theme.themeId;
|
||||
}
|
||||
extra[@"index"] = @(indexPath.item);
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_my_skin_theme_card"
|
||||
pageId:@"my_skin"
|
||||
elementId:@"theme_card"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
KBSkinDetailVC *vc = [[KBSkinDetailVC alloc] init];
|
||||
vc.themeId = theme.themeId;
|
||||
[self.navigationController pushViewController:vc animated:true];
|
||||
|
||||
@@ -120,6 +120,19 @@
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
NSDictionary *info = self.data[indexPath.section][indexPath.row];
|
||||
NSString *itemID = info[@"id"];
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
if ([itemID isKindOfClass:NSString.class] && itemID.length > 0) {
|
||||
extra[@"item_id"] = itemID;
|
||||
}
|
||||
NSString *title = info[@"title"];
|
||||
if ([title isKindOfClass:NSString.class] && title.length > 0) {
|
||||
extra[@"item_title"] = title;
|
||||
}
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_my_menu_item"
|
||||
pageId:@"my"
|
||||
elementId:@"menu_item"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
if ([itemID isEqualToString:@"1"]) {
|
||||
[self.navigationController pushViewController:[KBNoticeVC new] animated:true];
|
||||
|
||||
@@ -159,6 +172,11 @@
|
||||
popover.permittedArrowDirections = 0;
|
||||
}
|
||||
UIPasteboard.generalPasteboard.string = textToCopy;
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_my_invite_copy"
|
||||
pageId:@"my"
|
||||
elementId:@"invite_copy"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self presentViewController:activityVC animated:YES completion:nil];
|
||||
});
|
||||
}];
|
||||
|
||||
@@ -202,6 +202,18 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
NSInteger old = self.selectedIndex;
|
||||
self.selectedIndex = indexPath.item;
|
||||
|
||||
KBPayProductModel *item = (indexPath.item < self.data.count) ? self.data[indexPath.item] : nil;
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
extra[@"index"] = @(indexPath.item);
|
||||
if ([item.productId isKindOfClass:NSString.class] && item.productId.length > 0) {
|
||||
extra[@"product_id"] = item.productId;
|
||||
}
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_points_select_product"
|
||||
pageId:@"points_recharge"
|
||||
elementId:@"product_item"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
|
||||
KBJfPayCell *newCell = (KBJfPayCell *)[collectionView cellForItemAtIndexPath:indexPath];
|
||||
[newCell applySelected:YES animated:YES];
|
||||
if (old >= 0 && old < self.data.count) {
|
||||
@@ -319,6 +331,15 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
[KBHUD showInfo:KBLocalized(@"Please select a product")];
|
||||
return;
|
||||
}
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
if ([selectedItem.productId isKindOfClass:NSString.class] && selectedItem.productId.length > 0) {
|
||||
extra[@"product_id"] = selectedItem.productId;
|
||||
}
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_points_pay_btn"
|
||||
pageId:@"points_recharge"
|
||||
elementId:@"pay_btn"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
NSString *productId = selectedItem.productId;
|
||||
if (productId.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Product unavailable")];
|
||||
|
||||
@@ -293,6 +293,11 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
|
||||
#pragma mark - Action
|
||||
- (void)onTapClose{
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_close_btn"
|
||||
pageId:@"vip_pay"
|
||||
elementId:@"close_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self.navigationController popViewControllerAnimated:true];
|
||||
}
|
||||
|
||||
@@ -303,6 +308,15 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
[KBHUD showInfo:KBLocalized(@"Please select a product")];
|
||||
return;
|
||||
}
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
if ([plan.productId isKindOfClass:NSString.class] && plan.productId.length > 0) {
|
||||
extra[@"product_id"] = plan.productId;
|
||||
}
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_pay_btn"
|
||||
pageId:@"vip_pay"
|
||||
elementId:@"pay_btn"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
NSString *productId = plan.productId;
|
||||
if (productId.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Product unavailable")];
|
||||
@@ -326,6 +340,11 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
}
|
||||
|
||||
- (void)onTapRestoreButton {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_restore_btn"
|
||||
pageId:@"vip_pay"
|
||||
elementId:@"restore_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[KBHUD show];
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[[KBStoreKitBridge shared] restorePurchasesWithCompletion:^(BOOL success, NSString * _Nullable message) {
|
||||
@@ -386,6 +405,18 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
if (self.selectedIndex == indexPath.item) { return; }
|
||||
NSInteger old = self.selectedIndex;
|
||||
self.selectedIndex = indexPath.item;
|
||||
|
||||
KBPayProductModel *plan = (indexPath.item < self.plans.count) ? self.plans[indexPath.item] : nil;
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
extra[@"index"] = @(indexPath.item);
|
||||
if ([plan.productId isKindOfClass:NSString.class] && plan.productId.length > 0) {
|
||||
extra[@"product_id"] = plan.productId;
|
||||
}
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_select_plan"
|
||||
pageId:@"vip_pay"
|
||||
elementId:@"plan_item"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
|
||||
KBVipSubscribeCell *newCell = (KBVipSubscribeCell *)[collectionView cellForItemAtIndexPath:indexPath];
|
||||
[newCell applySelected:YES animated:YES];
|
||||
|
||||
@@ -120,6 +120,13 @@ static NSString * const kResultCellId = @"KBSkinCardCell";
|
||||
KBSearchThemeModel *model = self.resultItems[indexPath.item];
|
||||
NSString *themeId = [model.themeId stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
if (themeId.length == 0) { return; }
|
||||
NSDictionary *extra = @{@"theme_id": themeId,
|
||||
@"index": @(indexPath.item)};
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_result_theme"
|
||||
pageId:@"search_result"
|
||||
elementId:@"result_theme_card"
|
||||
extra:extra
|
||||
completion:nil];
|
||||
KBSkinDetailVC *vc = [[KBSkinDetailVC alloc] init];
|
||||
vc.themeId = themeId;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
|
||||
@@ -244,6 +244,11 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
|
||||
|
||||
/// 清空历史
|
||||
- (void)clearHistory {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_clear_history"
|
||||
pageId:@"search"
|
||||
elementId:@"clear_history"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self.historyWords removeAllObjects];
|
||||
self.historyExpanded = NO;
|
||||
[self saveHistoryWordsToLocal:self.historyWords];
|
||||
@@ -369,10 +374,22 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
|
||||
NSArray *list = [self currentDisplayHistory];
|
||||
NSString *kw = list[indexPath.item];
|
||||
if ([kw isEqualToString:kMoreToken]) {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_history_more"
|
||||
pageId:@"search"
|
||||
elementId:@"history_more"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
// 展开所有历史
|
||||
self.historyExpanded = YES;
|
||||
[self.collectionView reloadData];
|
||||
} else {
|
||||
NSDictionary *extra = @{@"index": @(indexPath.item),
|
||||
@"keyword_len": @(kw.length)};
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_history_item"
|
||||
pageId:@"search"
|
||||
elementId:@"history_item"
|
||||
extra:extra
|
||||
completion:nil];
|
||||
[self.searchBarView updateKeyword:kw];
|
||||
[self performSearch:kw];
|
||||
[self openResultForKeyword:kw];
|
||||
@@ -381,6 +398,16 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
|
||||
}
|
||||
if (indexPath.section == KBSearchSectionRecommend) {
|
||||
KBShopThemeModel *model = self.recommendedThemes[indexPath.item];
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
extra[@"index"] = @(indexPath.item);
|
||||
if ([model.themeId isKindOfClass:NSString.class] && model.themeId.length > 0) {
|
||||
extra[@"theme_id"] = model.themeId;
|
||||
}
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_recommend_theme"
|
||||
pageId:@"search"
|
||||
elementId:@"recommend_theme_card"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
[self openDetailForThemeId:model.themeId ?: @""];
|
||||
}
|
||||
}
|
||||
@@ -394,6 +421,12 @@ typedef NS_ENUM(NSInteger, KBSearchSection) {
|
||||
// _searchBarView.placeholder = @"Themes";
|
||||
KBWeakSelf
|
||||
_searchBarView.onSearch = ^(NSString * _Nonnull keyword) {
|
||||
NSDictionary *extra = @{@"keyword_len": @(keyword.length)};
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_search_submit"
|
||||
pageId:@"search"
|
||||
elementId:@"search_submit"
|
||||
extra:extra
|
||||
completion:nil];
|
||||
// 置顶到历史 + 打开结果页
|
||||
[weakSelf performSearch:keyword];
|
||||
[weakSelf openResultForKeyword:keyword];
|
||||
|
||||
@@ -173,6 +173,16 @@
|
||||
|
||||
- (void)kb_handleShopTapAtIndexPath:(NSIndexPath *)indexPath {
|
||||
KBShopThemeModel *selTheme = (indexPath.item < self.dataSource.count) ? self.dataSource[indexPath.item] : nil;
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
if ([selTheme.themeId isKindOfClass:NSString.class] && selTheme.themeId.length > 0) {
|
||||
extra[@"theme_id"] = selTheme.themeId;
|
||||
}
|
||||
extra[@"index"] = @(indexPath.item);
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_shop_theme_card"
|
||||
pageId:@"shop_item_list"
|
||||
elementId:@"theme_card"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
KBSkinDetailVC *vc = [[KBSkinDetailVC alloc] init];
|
||||
vc.themeId = selTheme.themeId;
|
||||
[self.navigationController pushViewController:vc animated:true];
|
||||
|
||||
@@ -244,11 +244,21 @@ static const CGFloat JXheightForHeaderInSection = 50;
|
||||
|
||||
#pragma mark - action
|
||||
- (void)searchBtnAction{
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_shop_search_btn"
|
||||
pageId:@"shop"
|
||||
elementId:@"search_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
KBSearchVC *vc = [[KBSearchVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:true];
|
||||
}
|
||||
|
||||
- (void)skinBtnAction{
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_shop_my_skin_btn"
|
||||
pageId:@"shop"
|
||||
elementId:@"my_skin_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
MySkinVC *vc = [[MySkinVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:true];
|
||||
}
|
||||
|
||||
@@ -130,6 +130,18 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
|
||||
if (nextThemeId.length == 0) { return; }
|
||||
if ([nextThemeId isEqualToString:self.themeId ?: @""]) { return; }
|
||||
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
if ([self.themeId isKindOfClass:NSString.class] && self.themeId.length > 0) {
|
||||
extra[@"from_theme_id"] = self.themeId;
|
||||
}
|
||||
extra[@"to_theme_id"] = nextThemeId;
|
||||
extra[@"index"] = @(indexPath.item);
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_skin_recommend_card"
|
||||
pageId:@"skin_detail"
|
||||
elementId:@"recommend_card"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
|
||||
// 不跳转新页面:直接切换 themeId,重新请求详情并刷新当前页面
|
||||
self.themeId = nextThemeId;
|
||||
self.detailModel = nil;
|
||||
@@ -242,6 +254,16 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
|
||||
[KBHUD showInfo:KBLocalized(@"正在加载主题详情")];
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
|
||||
extra[@"theme_id"] = self.themeId ?: @"";
|
||||
extra[@"purchased"] = @(self.detailModel.isPurchased);
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_skin_download_btn"
|
||||
pageId:@"skin_detail"
|
||||
elementId:@"download_btn"
|
||||
extra:extra.copy
|
||||
completion:nil];
|
||||
|
||||
NSLog(@"🧩[SkinDetail] action themeId=%@ purchased=%d", self.themeId, self.detailModel.isPurchased);
|
||||
if (self.detailModel.isPurchased) {
|
||||
[self requestDownload];
|
||||
|
||||
@@ -193,7 +193,11 @@ static void *KBPermPlayerPresentationSizeContext = &KBPermPlayerPresentationSize
|
||||
}
|
||||
|
||||
- (void)openSettings {
|
||||
[self report];
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_permission_open_settings_btn"
|
||||
pageId:@"keyboard_permission_guide"
|
||||
elementId:@"open_settings_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
|
||||
UIApplication *app = [UIApplication sharedApplication];
|
||||
if ([app canOpenURL:url]) {
|
||||
@@ -206,6 +210,11 @@ static void *KBPermPlayerPresentationSizeContext = &KBPermPlayerPresentationSize
|
||||
}
|
||||
|
||||
- (void)closeButtonAction{
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_permission_close_btn"
|
||||
pageId:@"keyboard_permission_guide"
|
||||
elementId:@"close_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[self.navigationController popViewControllerAnimated:true];
|
||||
}
|
||||
|
||||
@@ -286,13 +295,6 @@ static void *KBPermPlayerPresentationSizeContext = &KBPermPlayerPresentationSize
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
|
||||
#pragma mark - network
|
||||
- (void)report{
|
||||
[[KBMaiPointReporter sharedReporter] reportNewAccountWithType:@"键盘申请授权" account:nil completion:^(BOOL success, NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Lazy Subviews
|
||||
|
||||
- (UIButton *)backButton {
|
||||
|
||||
Reference in New Issue
Block a user