pusher / docs

The all new Pusher docs, powered by @11ty and @vercel
https://pusher.com/docs
8 stars 15 forks source link

Undefined show in Notification Title #322

Open TJSoar opened 6 months ago

TJSoar commented 6 months ago

Hello there, I spotted an issue on https://pusher.com/docs/beams/guides/publish-to-specific-user/web/

Everytime I send a notification either from direct code or using postman, I see undefined on chrome notification instead of title and body set in code.

Even using the debug console on website it is same. image

benw-pusher commented 6 months ago

Can you share the OS and Chrome versions? Are you customising the receipt of the notification in any way? I have tested this (Chrome, Mac) and the title shows as I would expect. If you could share the code used that would be helpful.

TJSoar commented 6 months ago

I am using windows 11 and Chrome Version is Version 121.0.6167.161 (Official Build) (64-bit)

this is the postman post request

curl --location 'https://PUSHER_INSTANCE_ID.pushnotifications.pusher.com/publish_api/v1/instances/PUSHER_INSTANCE_ID/publishes' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer PUSHER_BEARER_TOKEN' \
--data '{
    "interests": [
        "debug-hello"
    ],
    "web": {
        "notification": {
            "title": "Hello",
            "name":"Hello",
            "body": "Hello, world!",
            "icon": "https://dev.studyknight.in/wp-content/plugins/sk-plugin/theme/logo.png",
            "deep_link": "htttps://dev.studyknight.in"
        },
        "data": {
            "some": "metadata",
            "of": "your",
            "choosing": "can",
            "go": "here 😏"
        }
    }
}'

and below is the code to register interest

const beamsClient = new PusherPushNotifications.Client({
        instanceId: 'PUSHER_INSTANCE_ID',
    });
beamsClient.start()
    .then(() => beamsClient.addDeviceInterest('debug-hello'))
    .then(() => console.log('Successfully registered and subscribed!'))
    .catch(console.error);