Skip to content

Commit

Permalink
Update trackReceivedEvent to allow influence opens to be logged/sent …
Browse files Browse the repository at this point in the history
…to Firebase
  • Loading branch information
jennantilla committed Mar 30, 2023
1 parent 7340bf0 commit b5997c8
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 b5997c8

Please sign in to comment.