Expanded getNotificationRule to include contactId and improved accuracy of finding the latest notification occurrence from a list