Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove early return of trackReceivedEvent to allow for os_notification_influence_open event to be sent to Firebase #1241

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,11 @@ + (void)trackOpenEvent:(OSNotificationOpenedResult*)results {
}

+ (void)trackReceivedEvent:(OSNotification*)notification {
if (!trackingEnabled)
return;

NSString *campaign = [self getCampaignNameFromNotification:notification];
OneSignalUserDefaults *sharedUserDefaults = OneSignalUserDefaults.initShared;
[sharedUserDefaults saveStringForKey:ONESIGNAL_FB_LAST_NOTIFICATION_ID_RECEIVED withValue:notification.notificationId];
[sharedUserDefaults saveStringForKey:ONESIGNAL_FB_LAST_GAF_CAMPAIGN_RECEIVED withValue:campaign];
[sharedUserDefaults saveDoubleForKey:ONESIGNAL_FB_LAST_TIME_RECEIVED withValue:[[NSDate date] timeIntervalSince1970]];

[self logEventWithName:@"os_notification_received"
parameters:@{
@"source": @"OneSignal",
@"medium": @"notification",
@"notification_id": notification.notificationId,
@"campaign": campaign
}];
}

+ (void)trackInfluenceOpenEvent {
Expand Down