Message notifications are not triggered when using WappPress

“I have WappPress Pro + HivePress on jammingads.com. Test pushes with sound work fine. Private replies (buyer to ad poster messages) do not trigger any push. Your built-in triggers only do new posts/comments. Can you give me the exact simple code or settings to make private messages send a push with sound to the recipient? I already have Firebase set up and the APK working.”

Thanks for your message — our team will reply shortly.

In the meantime, you can also get instant help from our AI Assistant, familiar with all the docs and solutions we’ve shared over the years.

Hi,

We don’t have a special integration with this plugin. Could you please provide more details? Did you create a custom integration, or how did you connect the Messages plugin with the push notifications from this plugin?

If you haven’t set anything up yet and have a developer or someone familiar with coding, we can suggest which hooks to use to make this work.

Hi,

Thanks for the quick reply.

No, I have not created any custom integration yet. The only push notifications that currently work are the manual test pushes I send from inside WappPress and the built-in triggers for “New Post” and “New Comment”. Private replies from the HivePress Messages plugin do not trigger any push at all.

I am using your WappPress Pro plugin on jammingads.com with the HivePress classifieds plugin (including the Messages extension for private buyer-seller replies).

I would like the simplest possible way to make private message replies send a push notification with sound to the recipient’s phone in the Android app.

If you can suggest the exact hooks to use and provide a simple code example (or settings) that works with WappPress Pro’s push system and Firebase, that would be perfect.

I do not have a developer on hand, so the simpler the solution the better.

Thanks, Rob

Thanks for the details.

If email notifications for new messages are enabled, the simplest hook you can use is hivepress/v1/emails/message_send/send:

add_action('hivepress/v1/emails/message_send/send', function($email) {
    // code that triggers a push notification here, for example by sending a webhook request or another way, depends on WappPress offered API
});

Alternatively, you can use the hivepress/v1/models/message/create hook. From the email object, you can get the message like this: $message = $email->get_tokens()['message'];

In the second hook, the function may receive two parameters: $message_id and $message: Action: hivepress/v1/models/{model_name}/{action_type} | HivePress Hook Reference. Once you have the message object, you can access details such as sender or recipient emails, for example: $sender_email = $message->get_sender_email();.

Hope this helps, and wishing you a relaxing weekend