Commit 3058fb14 by pidan

修复线上闪退

parent 53528c31
......@@ -204,7 +204,7 @@
self.mtkView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.mtkView.backgroundColor = UIColor.clearColor;
self.mtkView.device = MTLCreateSystemDefaultDevice();
if (@available(iOS 15.0, *)) {
if (@available(iOS 16.0, *)) {
self.mtkView.colorPixelFormat = MTLPixelFormatRGBA8Unorm;
} else {
self.mtkView.colorPixelFormat = MTLPixelFormatBGRA8Unorm;
......
......@@ -229,8 +229,9 @@
NSUserDefaults *userDefault = [[NSUserDefaults alloc] initWithSuiteName:[FUSCacheDataShare shareStore].userDetailInfo.uid];
NSInteger currentTime = (NSInteger)[[NSDate date] timeIntervalSince1970];
[userDefault setInteger:currentTime + model.nextTime forKey:FUSSevenDayCheckinStore_nextCheckInTimeUDKey];
if (weakSelf.dismissHandler) {
weakSelf.dismissHandler();
}
[weakSelf removeFromSuperview];
FUSCheckInRewardItemModel *rewardModel = model.rewardList.firstObject;
......
......@@ -1787,18 +1787,18 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[weakSelf.endedView fus_updateLikeBtnWithIsLike:NO];
[[[FUSLiveHelper shareInstance] roomInfoModel] setLiked:@"0"];
[FUSDialogView fus_showDialog:[NSString fus_localString:@"取消追踪成功"]];
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_FocusBaoFang_Refresh object:@{@"roomId":[[[FUSLiveHelper shareInstance] roomInfoModel] roomId],@"like":@(NO)}];
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_FocusBaoFang_Refresh object:@{@"roomId":[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] ?: @"",@"like":@(NO)}];
} failure:^(NSString *msg, int code) {
[FUSDialogView fus_showDialog:msg];
}];
} else {
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_ENDROOM_FOLLOW label:nil parameters:@{@"fid":[[[FUSLiveHelper shareInstance] roomInfoModel] roomId]}];
[FUSTalkingData fus_trackEvent:FUSLiveEventTrackParams.fus_EVENT_ENDROOM_FOLLOW label:nil parameters:@{@"fid":[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] ?: @""}];
// 未追踪,执行追踪
[FUSLiveHttpHelper fus_likeRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] success:^{
[weakSelf.endedView fus_updateLikeBtnWithIsLike:YES];
[[[FUSLiveHelper shareInstance] roomInfoModel] setLiked:@"1"];
[FUSDialogView fus_showDialog:[NSString fus_localString:@"追踪成功"]];
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_FocusBaoFang_Refresh object:@{@"roomId":[[[FUSLiveHelper shareInstance] roomInfoModel] roomId],@"like":@(YES)}];
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_FocusBaoFang_Refresh object:@{@"roomId":[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] ?: @"",@"like":@(YES)}];
} failure:^(NSString *msg, int code) {
[FUSDialogView fus_showDialog:msg];
}];
......
......@@ -2577,6 +2577,11 @@
/// @param succeed 成功
/// @param failure 失败
+ (void)fus_requestLivePraiseSendWithRoomId:(NSString *)roomId num:(NSInteger)num succeed:(void (^)(void))succeed failure:(void (^)(NSString *, NSInteger))failure{
if ([NSString isNullWithString:roomId]) {
return;
}
NSDictionary *parm = @{@"roomId": roomId,
@"num":[NSString stringWithFormat:@"%ld",num]};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_ROOM_PRAISE_SEND params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
......
......@@ -1700,12 +1700,16 @@
for (NSString *remindKey in FUSLiveHelper.shareInstance.roomInfoModel.reminderKeys) {
NSString *remindStr = FUSCacheDataShare.shareStore.roomRemindDict[remindKey];
if (![NSString isNullWithString:remindStr]) {
NSString *shownStr = [remindStr stringByReplacingOccurrencesOfString:@"{anchornick}" withString:anchornick];
shownStr = [shownStr stringByReplacingOccurrencesOfString:@"{usernick}" withString:usernick];
[message appendString:shownStr];
if (![NSString isNullWithString:remindStr]) {
[message appendString:remindStr];
[message appendString:@"<br>"];
}
}
}
model.type = STR(CID_ACTIVE_SYSTEM_WARNING);
} else {
......
......@@ -183,6 +183,10 @@
- (void)fus_loadData {
if ([NSString isNullWithString:FUSLiveHelper.shareInstance.roomInfoModel.roomId]) {
return;
}
NSDictionary *params = @{
@"roomId":FUSLiveHelper.shareInstance.roomInfoModel.roomId,
@"type":@(self.isVipOnly ? 1 : 0),
......
......@@ -816,7 +816,7 @@
// [self.likeBtn setImage:[FUSShowRoomCenterBunble imageNamed:@"live_head_follow_tick_btn"] forState:UIControlStateNormal];
[FUSDialogView fus_showDialog:[NSString fus_localString:@"追踪成功"]];
[[FUSLiveHelper shareInstance]roomInfoModel].liked = @"1";
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_FocusBaoFang_Refresh object:@{@"roomId":self.currentModel.roomId,@"like":@(YES)}];
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_FocusBaoFang_Refresh object:@{@"roomId":self.currentModel.roomId ?: @"",@"like":@(YES)}];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment