-
Hello Will,
You should remove this code. New you just need to add AppID and a few other parameters to Studio -> Settings -> Push Notifications area and push notification will work in messenger and for una notifications.
I hope when you remove it, all the problems with push notification on your site wil disappear.