Search code examples
phpwordpressbuddypress

how to get notification_id after send friend request hook in buddypress


I am using buddypress 2.4.0 I am want to do GCM call after this action

  1. send friend request
  2. Accept friend request

But I am not getting any appropriate hook for that. The hook I am using done not have the parameter notification_id. Please help me out


Solution

  • Use this hook:

    do_action_ref_array( 'bp_notification_after_save', array( &$this ) );
    

    Found in:

    buddypress\bp-notifications\classes\class-bp-notifications-notification.php
    

    Check the component_name in the passed array and if it is something like friends - proceed with your task.