Skip to main content

 

Hi everyone,

I am developing a discourse feature like twitter where users post responses to challenges (a post like entity in my app) and then other users can comment, reply and like on other responses. I plan to send notifications to all users (parent thread) when user replies on a comment or likes a comment. I am using push notification for this. 

I am successfully able to send the push notification, but I also want that notification to be sent to my BE server via a webhook once notification is delivered successfully. I have configured the webhook on push events and the send test works just fine. But when I try to send a actual push notification and the expect the webhook to be received on the endpoint, I don’t get any regardless the push notification being delivered successfully
 

class CustomerIOClient:
def __init__(self):
self.api_client = APIClient(settings.CUSTOMER_IO_APP_API_KEY)

def send_push_notification(
self,
email,
body,
link,
transactional_message_id="default_push_message",
):
"""
Send a push notification to all devices of a user identified by email
"""

try:
request = SendPushRequest(
transactional_message_id=transactional_message_id,
identifiers={"email": email},
message=body,
link=link,
)
response = self.api_client.send_push(request)
return response
except CustomerIOException as e:
logger.error(e)
logger.error("could not send notification")

 

Hi

This sounds rather tricky.. When you say that as soon as you send a push notification it does send the push but not trigger the reporting webhook: did you just send a test push from the message composer (by providing a device token)? Or a real push triggered by your backend? 

I’m just suspecting that maybe those test sends will not get reported (and not logged to a specific person in customer.io)

André


Hey Andre,

I did a proper push from the backend server using the email identifier and the real push notification sent was successfully delivered to the respective device, but not the webhook delivered to the backend server. Also the test webhook push works fine and gives me this data, but the actual one is not triggered when push notifications are sent

Here is the test webhook data I am receiving on my webhook endpoint:

 

{'data': {'action_id': 42, 'campaign_id': 23, 'content': 'Welcome to the club, we are with you.', 'customer_id': 'user-123', 'delivery_id': 'RAECAAFwnUSneIa0ZXkmq8EdkAM==', 'headers': {'Custom-Header':  'custom-value']}, 'identifiers': {'id': 'user-123'}, 'recipient': 'test@example.com', 'subject': 'Thanks for signing up'}, 'event_id': '01E2EMRMM6TZ12TF9WGZN0WJQT', 'metric': 'sent', 'object_type': 'email', 'timestamp': 1723611465}

Thanks.


Reply