The tokens are generated by Firebase and sent to the client-side application, which could be web, iOS, Android, etc. The Firebase docs explain how to get the tokens: firebase.google.com/docs/cloud-messaging/js/clien…
This article covers only the server side (storing the tokens and making push notifications). I think the diagram here makes the flow a little clearer: tosinjs.hashnode.dev/build-a-push-notification-se…