Before notifications are registered you need register a hook to set owner_guid for the notification. (Owner GUID for user who will receive the notification)

A working example can be found on https://www.opensource-socialnetwork.org/component/view/5526/notification-sample
~~~
<?php
function my_component_init(){
//ossn_add_hook('notification:add', <type>, 'ossn_notificaiton_groups_comments_hook');
//example for type `notification:message:tomyself`
ossn_add_hook('notification:add', 'notification:message:tomyself', 'notificationsamplemyself_add_config'); ;
}
function notificationsamplemyself_add_config($hook, $type, $return, $params){
error_log("in notificationsamplemyself_add_config function");
$params['owner_guid'] = $params['notification_owner'];
return $params;
}
ossn_register_callback('ossn', 'init', 'my_component_init');
~~~

Notification add hook