Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined show in Notification Title #322

Open
TJSoar opened this issue Feb 14, 2024 · 2 comments
Open

Undefined show in Notification Title #322

TJSoar opened this issue Feb 14, 2024 · 2 comments

Comments

@TJSoar
Copy link

TJSoar commented Feb 14, 2024

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
Copy link
Contributor

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
Copy link
Author

TJSoar commented Feb 14, 2024

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants