File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 6565 @" Starship_Type" : @" Death Star"
6666 }];
6767 });
68-
68+
6969 it (@" track with event name and parmas separated by periods" , ^{
7070 SEGTrackPayload *payload = [[SEGTrackPayload alloc ] initWithEvent: @" Starship.Ordered"
7171 properties: @{
7272 @" Starship.Type" : @" Death Star"
7373 }
7474 context: @{}
7575 integrations: @{}];
76-
76+
7777 [integration track: payload];
7878 [verify (mockFirebase) logEventWithName: @" Starship_Ordered" parameters: @{
7979 @" Starship_Type" : @" Death Star"
8080 }];
8181 });
82-
82+
8383 it (@" track with leading and trailing spacing for event name" , ^{
8484 SEGTrackPayload *payload = [[SEGTrackPayload alloc ] initWithEvent: @" Starship Ordered "
8585 properties: @{
8686 @" Starship.Type" : @" Death Star"
8787 }
8888 context: @{}
8989 integrations: @{}];
90-
90+
9191 [integration track: payload];
9292 [verify (mockFirebase) logEventWithName: @" Starship_Ordered" parameters: @{
9393 @" Starship_Type" : @" Death Star"
555555 }];
556556 });
557557
558+ it (@" track screen with name" , ^{
559+ SEGScreenPayload *payload = [[SEGScreenPayload alloc ] initWithName: @" Home screen"
560+ properties: @{}
561+ context: @{}
562+ integrations: @{}];
563+ [integration screen: payload];
564+ [verify (mockFirebase) setScreenName: @" Home screen" screenClass: nil ];
565+ });
566+
558567});
559568
560569SpecEnd
Original file line number Diff line number Diff line change @@ -64,6 +64,13 @@ - (void)track:(SEGTrackPayload *)payload
6464}
6565
6666
67+ - (void )screen : (SEGScreenPayload *)payload
68+ {
69+ [self .firebaseClass setScreenName: payload.name screenClass: nil ];
70+ SEGLog (@" [FIRAnalytics setScreenName:%@ ]" , payload.name );
71+ }
72+
73+
6774#pragma mark - Utilities
6875
6976// Event names can be up to 32 characters long, may only contain alphanumeric
You can’t perform that action at this time.
0 commit comments