Notification analytics on the device

Since plugin version 1.15.0 it is possible to listen to notification events. This feature is especially useful when you want to tie the plugin to your own analytics.

Currently we offer notification events upon showing a notification to the user (sent notification event) and whenever a user taps on a notification (opened notification event).

Whenever such an event happens our plugin will call the appropriate method. The delegate passed to [Plot initializeWithDelegate:] may implement the optional methods -(void)plotNotificationSentEvent:(PlotSentNotification*)notification and -(void)plotNotificationOpenedEvent:(PlotSentNotification*)notification to make use of this feature.

See an example implementation below for the notification sent event:

-(void)plotNotificationSentEvent:(PlotSentNotification*)notification {
  NSString* message = [notification.userInfo objectForKey:PlotNotificationMessage];
  NSLog(@"Notification Sent Event: message: %@", message);
  // Make a call to Google Analytics
}

And an example for when a notification is opened:

-(void)plotNotificationOpenedEvent:(PlotSentNotification*)notification {
  NSString* data = [notification.userInfo objectForKey:PlotNotificationDataKey];
  NSLog(@"Notification Opened Event: data: %@", data);
  // Make a call to Google Analytics
}