braze-inc / braze-web-sdk

Public repo for the Braze Web SDK
https://www.braze.com
Other
70 stars 25 forks source link

[Bug]: appboy.registerAppboyPushMessages not working on Safari #115

Closed sonnguyprophet closed 2 years ago

sonnguyprophet commented 2 years ago

Braze Web SDK Version

3.5

Integration Method

Other (please specify)

Browser

Safari

Steps To Reproduce

I have converted this sample into Nuxt Js demo project

When this function is called on Safari

appboy.registerAppboyPushMessages(function() {
        appboy.logCustomEvent("send me push");
        appboy.requestImmediateDataFlush();
});

nothing happened and only the logs

Appboy: The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.

Expected Behavior

I expected the prompt for push notifications permissions to appear

Actual Incorrect Behavior

nothing happened, no prompt and no error, only the log above.

Verbose Logs

Appboy: Initialized for the Braze backend at "https://sdk.iad-01.braze.com/api/v3" with API key "e491231d-c4ae-466d-8f7f-ba8ad308f12a".

Additional Information

No response

davidbielik commented 2 years ago

Hi @sonnguyprophet can you please confirm the following:

It looks like you haven't replaced the safariWebsitePushID, for example: https://github.com/sonnguyprophet/demo-safari-braze-notification/blob/master/app.html#L47

sonnguyprophet commented 2 years ago

Hi @davidbielik,

But still got the same message. Link for testing: https://test-safari-braze-notification.herokuapp.com/

davidbielik commented 2 years ago

Hi @sonnguyprophet thanks for confirming. One other question, does it work as expected in chrome or Firefox? Or do you see an error message in another browser?

sonnguyprophet commented 2 years ago

@davidbielik it work well on Chrome and Firefox. You can test it on this site https://test-safari-braze-notification.herokuapp.com/

wesleyorbin commented 2 years ago

Hi @sonnguyprophet. The most common cause for this issue is an incorrect configuration in the Braze dashboard or a bad push certificate. I recommend that you reach out to our support team, as they'll be able to help you diagnose the issue more quickly.