Skip to content

Commit

Permalink
Update trackReceivedEvent to allow Firebase influence
Browse files Browse the repository at this point in the history
Cherry pick of #1241

Also adding crash protection against a nil notificaiton id and campaign
  • Loading branch information
emawby authored and nan-li committed Oct 30, 2023
1 parent cfff80a commit 3c5af2f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,18 @@ + (void)trackInfluenceOpenEvent {
NSString *campaign = [sharedUserDefaults getSavedStringForKey:ONESIGNAL_FB_LAST_GAF_CAMPAIGN_RECEIVED defaultValue:nil];

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:@{
@"source": @"OneSignal",
@"medium": @"notification"
@"source": @"OneSignal",
@"medium": @"notification"
}];

if (notificationId) {
params[@"notification_id"] = notificationId;
}
if (campaign) {
params[@"campaign"] = campaign;
}
[self logEventWithName:@"os_notification_influence_open"
parameters:params];
parameters:params];
}

@end

0 comments on commit 3c5af2f

Please sign in to comment.