diff --git a/archive/Debug/fir-xplan-ios.png b/archive/Debug/fir-xplan-ios.png index 013a63c9..5f68f475 100644 Binary files a/archive/Debug/fir-xplan-ios.png and b/archive/Debug/fir-xplan-ios.png differ diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 92accc39..9e6fbecf 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -1213,6 +1213,8 @@ E8F1558D28124D5200EE8C06 /* MessageConentAudioView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F1558C28124D5200EE8C06 /* MessageConentAudioView.m */; }; E8F1559028125E2D00EE8C06 /* MessageAudioCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F1558F28125E2D00EE8C06 /* MessageAudioCenter.m */; }; E8F1559328129EBA00EE8C06 /* ContentSecretaryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F1559228129EBA00EE8C06 /* ContentSecretaryModel.m */; }; + E8F6135C291E26BD00E12650 /* NSMutableDictionary+Saft.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F6135B291E26BD00E12650 /* NSMutableDictionary+Saft.m */; }; + E8F6135F291E274E00E12650 /* NSArray+Safe.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F6135E291E274E00E12650 /* NSArray+Safe.m */; }; E8F65C1F286998C9009BB5B9 /* XPMineShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F65C1E286998C9009BB5B9 /* XPMineShareViewController.m */; }; E8F65C222869A36F009BB5B9 /* ContentShareMonentsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F65C212869A36F009BB5B9 /* ContentShareMonentsModel.m */; }; E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168327EC913C00F10D8F /* XPHomeLittleGameViewController.m */; }; @@ -3494,6 +3496,10 @@ E8F1558F28125E2D00EE8C06 /* MessageAudioCenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageAudioCenter.m; sourceTree = ""; }; E8F1559128129EBA00EE8C06 /* ContentSecretaryModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentSecretaryModel.h; sourceTree = ""; }; E8F1559228129EBA00EE8C06 /* ContentSecretaryModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentSecretaryModel.m; sourceTree = ""; }; + E8F6135A291E26BD00E12650 /* NSMutableDictionary+Saft.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+Saft.h"; sourceTree = ""; }; + E8F6135B291E26BD00E12650 /* NSMutableDictionary+Saft.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+Saft.m"; sourceTree = ""; }; + E8F6135D291E274E00E12650 /* NSArray+Safe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSArray+Safe.h"; sourceTree = ""; }; + E8F6135E291E274E00E12650 /* NSArray+Safe.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Safe.m"; sourceTree = ""; }; E8F65C1D286998C9009BB5B9 /* XPMineShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineShareViewController.h; sourceTree = ""; }; E8F65C1E286998C9009BB5B9 /* XPMineShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineShareViewController.m; sourceTree = ""; }; E8F65C202869A36F009BB5B9 /* ContentShareMonentsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentShareMonentsModel.h; sourceTree = ""; }; @@ -3962,6 +3968,7 @@ 189DD5A726DFA09700AB55B1 /* Tool */ = { isa = PBXGroup; children = ( + E8F61356291E269700E12650 /* Safe */, E8E8598328264C2200EE4857 /* CocoaHttpServer */, 9B09979F27F19D1C00EB8F14 /* QGVAPlayer */, 9B33E3C827D85379003B0E62 /* File */, @@ -8889,6 +8896,17 @@ path = MineInfo; sourceTree = ""; }; + E8F61356291E269700E12650 /* Safe */ = { + isa = PBXGroup; + children = ( + E8F6135A291E26BD00E12650 /* NSMutableDictionary+Saft.h */, + E8F6135B291E26BD00E12650 /* NSMutableDictionary+Saft.m */, + E8F6135D291E274E00E12650 /* NSArray+Safe.h */, + E8F6135E291E274E00E12650 /* NSArray+Safe.m */, + ); + path = Safe; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -9630,6 +9648,7 @@ E8C6FFD027548256004DC9F0 /* XPHomeListCollectionViewCell.m in Sources */, E8A1F794290642500099C952 /* XPRoomMorePlayViewController.m in Sources */, E84BF7DD277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m in Sources */, + E8F6135C291E26BD00E12650 /* NSMutableDictionary+Saft.m in Sources */, E8E859C428264C2300EE4857 /* HTTPDynamicFileResponse.m in Sources */, E8E859D028264C2300EE4857 /* DDData.m in Sources */, E800162F2803FF6200D6D17A /* GuildPersonIncomeRecordModel.m in Sources */, @@ -9898,6 +9917,7 @@ E8EEB90F26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m in Sources */, E873EB09280960990071030D /* XPMineUserInfoVoiceCardView.m in Sources */, E8AC723A26F49AAE007D6E91 /* XPMineNotifyStatus.m in Sources */, + E8F6135F291E274E00E12650 /* NSArray+Safe.m in Sources */, 18E7B33226F317A20064BC9B /* XPWebViewController.m in Sources */, E8AEAEF927141CA30017FCE0 /* RoomHeaderView.m in Sources */, 9B53D57A28E2CF18005187A3 /* XPTeenagerHomeView.m in Sources */, @@ -10328,7 +10348,7 @@ CODE_SIGN_ENTITLEMENTS = "xplan-ios/xplan-ios.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 202205051140; + CURRENT_PROJECT_VERSION = 2022111001; DEVELOPMENT_TEAM = 48UCG35Q9W; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -10360,7 +10380,7 @@ CODE_SIGN_ENTITLEMENTS = "xplan-ios/xplan-iosRelease.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 202205051140; + CURRENT_PROJECT_VERSION = 2022111001; DEVELOPMENT_TEAM = 48UCG35Q9W; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/xplan-ios/Base/Tool/Safe/NSArray+Safe.h b/xplan-ios/Base/Tool/Safe/NSArray+Safe.h new file mode 100644 index 00000000..58e31143 --- /dev/null +++ b/xplan-ios/Base/Tool/Safe/NSArray+Safe.h @@ -0,0 +1,16 @@ +// +// NSArray+Safe.h +// xplan-ios +// +// Created by 冯硕 on 2022/11/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSArray (Safe) +-(id)safeObjectAtIndex1:(NSUInteger)index; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/Tool/Safe/NSArray+Safe.m b/xplan-ios/Base/Tool/Safe/NSArray+Safe.m new file mode 100644 index 00000000..3332cb3f --- /dev/null +++ b/xplan-ios/Base/Tool/Safe/NSArray+Safe.m @@ -0,0 +1,23 @@ +// +// NSArray+Safe.m +// xplan-ios +// +// Created by 冯硕 on 2022/11/11. +// + +#import "NSArray+Safe.h" + +@implementation NSArray (Safe) + +-(id)safeObjectAtIndex1:(NSUInteger)index{ + if ([self isKindOfClass:[NSArray class]]){ + if (self.count){ + if (self.count>index){ + return self[index]; + } + } + } + return nil; +} + +@end diff --git a/xplan-ios/Base/Tool/Safe/NSMutableDictionary+Saft.h b/xplan-ios/Base/Tool/Safe/NSMutableDictionary+Saft.h new file mode 100644 index 00000000..0ee34a74 --- /dev/null +++ b/xplan-ios/Base/Tool/Safe/NSMutableDictionary+Saft.h @@ -0,0 +1,16 @@ +// +// NSMutableDictionary+Saft.h +// xplan-ios +// +// Created by 冯硕 on 2022/11/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSMutableDictionary (Saft) +- (void)safeSetObject:(id)anObject forKey:(id )aKey; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/Tool/Safe/NSMutableDictionary+Saft.m b/xplan-ios/Base/Tool/Safe/NSMutableDictionary+Saft.m new file mode 100644 index 00000000..0aa28892 --- /dev/null +++ b/xplan-ios/Base/Tool/Safe/NSMutableDictionary+Saft.m @@ -0,0 +1,17 @@ +// +// NSMutableDictionary+Saft.m +// xplan-ios +// +// Created by 冯硕 on 2022/11/11. +// + +#import "NSMutableDictionary+Saft.h" + +@implementation NSMutableDictionary (Saft) + +- (void)safeSetObject:(id)anObject forKey:(id )aKey{ + if (anObject == nil || aKey == nil)return; + [self setObject:anObject forKey:aKey]; +} + +@end diff --git a/xplan-ios/Info.plist b/xplan-ios/Info.plist index 02af50b2..6109f568 100644 --- a/xplan-ios/Info.plist +++ b/xplan-ios/Info.plist @@ -38,7 +38,7 @@ CFBundleVersion - 2022031701 + 2022111001 LSApplicationQueriesSchemes pubgmhd1106467070 diff --git a/xplan-ios/Main/Home/Api/Api+Home.m b/xplan-ios/Main/Home/Api/Api+Home.m index 1e010820..9ae321fa 100644 --- a/xplan-ios/Main/Home/Api/Api+Home.m +++ b/xplan-ios/Main/Home/Api/Api+Home.m @@ -6,6 +6,7 @@ // #import "Api+Home.h" +#import "NSMutableDictionary+Saft.h" @implementation Api (Home) @@ -113,8 +114,10 @@ /// @param uid 用户的uid /// @param rid 进入的类型的id + (void)homePickResource:(HttpRequestHelperCompletion)completion uid:(NSString *)uid rid:(NSString *)rid { - NSDictionary * dic = @{@"uid":uid, @"id":rid}; - [HttpRequestHelper request:@"home/pickResource" method:HttpRequestHelperMethodGET params:dic completion:completion]; + NSMutableDictionary * pararms = [NSMutableDictionary dictionary]; + [pararms safeSetObject:uid forKey:@"uid"]; + [pararms safeSetObject:rid forKey:@"rid"]; + [HttpRequestHelper request:@"home/pickResource" method:HttpRequestHelperMethodGET params:pararms completion:completion]; } diff --git a/xplan-ios/Main/Home/View/SubViews/XPHomeLiveHeadView.m b/xplan-ios/Main/Home/View/SubViews/XPHomeLiveHeadView.m index a1815251..f48d3d64 100644 --- a/xplan-ios/Main/Home/View/SubViews/XPHomeLiveHeadView.m +++ b/xplan-ios/Main/Home/View/SubViews/XPHomeLiveHeadView.m @@ -14,6 +14,7 @@ ///View #import "XPHomeLiveRecordCell.h" #import "StatisticsServiceHelper.h" +#import "NSMutableDictionary+Saft.h" @interface XPHomeLiveHeadView() @@ -94,7 +95,9 @@ if (self.roomList.count > 0) { HomeRecommendRoomModel * liveModel = [self.roomList objectAtIndex:indexPath.item]; if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeLiveHeadViewDidClickItem:)]) { - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_card_click eventAttributes:@{@"roomUid" : liveModel.uid}]; + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + [dic safeSetObject:liveModel.uid forKey:@"roomUid"]; + [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_card_click eventAttributes:dic]; [self.delegate xPHomeLiveHeadViewDidClickItem:liveModel]; } } diff --git a/xplan-ios/Main/Home/View/XPHomeLivesViewController.m b/xplan-ios/Main/Home/View/XPHomeLivesViewController.m index 10f8767c..f26d65df 100644 --- a/xplan-ios/Main/Home/View/XPHomeLivesViewController.m +++ b/xplan-ios/Main/Home/View/XPHomeLivesViewController.m @@ -19,6 +19,7 @@ #import "XPHtmlUrl.h" #import "StatisticsServiceHelper.h" #import "XPWeakTimer.h" +#import "NSMutableDictionary+Saft.h" ///Model #import "HomeLiveTagModel.h" #import "HomeLiveLookRecordModel.h" @@ -210,7 +211,9 @@ - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { HomeLiveTagModel *tag = self.tagList[index]; - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventGebo_tab_click eventAttributes:@{@"geboTagName" : tag.sortName}]; + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + [dic safeSetObject: tag.sortName forKey:@"geboTagName"]; + [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventGebo_tab_click eventAttributes:dic]; } #pragma mark - JXPagerMainTableViewGestureDelegate diff --git a/xplan-ios/Main/Message/View/FindNew/Api/Api+FindNew.m b/xplan-ios/Main/Message/View/FindNew/Api/Api+FindNew.m index 4b9a73d5..b231c267 100644 --- a/xplan-ios/Main/Message/View/FindNew/Api/Api+FindNew.m +++ b/xplan-ios/Main/Message/View/FindNew/Api/Api+FindNew.m @@ -6,13 +6,15 @@ // #import "Api+FindNew.h" - +#import "NSMutableDictionary+Saft.h" @implementation Api (FindNew) ///发现萌新 + (void)findNewUser:(HttpRequestHelperCompletion)completion { - NSDictionary * dic = @{@"page":@"1", @"pageSize":@"20"}; - [HttpRequestHelper request:@"newbie/poolList" method:HttpRequestHelperMethodGET params:dic completion:completion]; + NSMutableDictionary * pararms = [NSMutableDictionary dictionary]; + [pararms safeSetObject:@"1" forKey:@"page"]; + [pararms safeSetObject:@"20" forKey:@"pageSize"]; + [HttpRequestHelper request:@"newbie/poolList" method:HttpRequestHelperMethodGET params:pararms completion:completion]; } diff --git a/xplan-ios/Main/Room/View/AnchorView/Model/XPAnchorAttentSendInfo.m b/xplan-ios/Main/Room/View/AnchorView/Model/XPAnchorAttentSendInfo.m index 9e086bd5..705edc19 100644 --- a/xplan-ios/Main/Room/View/AnchorView/Model/XPAnchorAttentSendInfo.m +++ b/xplan-ios/Main/Room/View/AnchorView/Model/XPAnchorAttentSendInfo.m @@ -6,19 +6,20 @@ // #import "XPAnchorAttentSendInfo.h" - +#import "NSMutableDictionary+Saft.h" @implementation XPAnchorAttentSendInfo - (NSDictionary *)encodeAttachemt { - - NSDictionary *dict = @{@"uid" :@(self.uid), - @"data":@{ - @"nick":self.nick == nil ? @"" : self.nick, - @"targetUid":@(self.targetUid), - @"targetNick":self.targetNick == nil ? @"" : self.targetNick, - } - }; - return dict; + + NSMutableDictionary * info = [NSMutableDictionary dictionary]; + [info safeSetObject:self.nick forKey:@"nick"]; + [info safeSetObject:@(self.targetUid) forKey:@"targetUid"]; + [info safeSetObject:self.targetNick forKey:@"targetNick"]; + + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + [dic safeSetObject:@(self.uid) forKey:@"uid"]; + [dic safeSetObject:info forKey:@"data"]; + return info; } @end