Skip to content

Commit

Permalink
Merge pull request #1241 from OneSignal/fix/firebase_influence_open
Browse files Browse the repository at this point in the history
Remove early return of trackReceivedEvent to allow for os_notification_influence_open event to be sent to Firebase
  • Loading branch information
jennantilla authored Apr 4, 2023
2 parents 0c1d008 + b5997c8 commit df4b162
Showing 1 changed file with 0 additions and 11 deletions.
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

0 comments on commit df4b162

Please sign in to comment.