Closed IceBotYT closed 3 years ago
Using the Chrome debug console and breakpoints I think the issue here is the scoping of the beamsClient
instance. The beamsClient
that works (for setting the user ID and initial registration) has a different scope that the beamsClient that is causing an error, which believe is contributing to the issue.
Perhaps it would be good to add the beamsClient to a global declaration within the JS file rather than embedded in the HTML <script>
tag.
That seems like a good idea
Nope, it's available now, but still not fixed.
Ok, so I just made some changes, and now, after setUserId()
gets called, the registration state becomes PERMISSION_GRANTED_NOT_REGISTERED_WITH_BEAMS
. Do you have any solutions to this?
You can check the registration state with checkRegistrationState()
.
Aha! I fixed it. Apparently, once you call setUserId()
, the user becomes unregistered, so you have to call .start()
again for it to work! 🎉
Hi there. I'm trying to create a push notification service for weather alerts, and having the user sign in with GitHub, but when I set up
.setUserId
, and I try to add an interest, I get this error:Here is my server code running the token provider:
It generates fine and returns fine.
Here is my front-end code. Warning: It gets messy.
And here's my client code:
Sorry if it's really long...
You may also visit the website here. Thank you for your help!
P.S. If you have any tips for making these issues better, please tell me!