Closed dlcole closed 10 months ago
Most likely you need to polyfill global.process as it's undefined in NativeScript, and these libraries check for process.env.
That said, I'd strongly recommend against using firebase-admin in your app. From the package documentation:
Please also note that the Admin SDK should only be used in server-side/back-end environments controlled by the app developer. This includes most server and serverless platforms (both on-premise and in the cloud). It is not recommended to use the Admin SDK in client-side environments.
Using it in your app is most likely result in your firebase credentials leaking and being abused, as opening up APKs and IPAs is trivial.
@edusperoni The only reason I was using firebase-admin is because that's the only example I saw in the @firebase-messaging doc. Should I be posting hhtp requests like I did with the older firebase plugin, but using the newer firebase API?
@dlcole the examples there are for the backend to send messages. In which case you need to have a backend with your credentials and expose an API that the user will call which in turn calls the admin SDK to post a message.
You'd usually need firebase messaging if you need to send messages to specific users (chat app, user send message to another user, you trigger a firebase message with the data), send messages independent of user action (ad campaign, etc), and similar things. If you need to display local notifications instantly or after a while you can use the local-notifications plugin
Earlier this week I, like others, started receiving web pack errors such as
I had over 200 such errors. After investigating for several hours, I edited my
webpack.config.js
file thusly:In short, I installed the packages suggested by the log file errors, such as util, and added the associated
require.resolve
, and set to false those items that did not have a suggested package. This resolved the build errors, but now I get a crash when I navigate to a page that requiresfirebase-admin
(so as to send firebase messages):I have to think these two are related, but I’m at a loss as to how to proceed. Can anyone confirm whether this is the correct approach to handling the webpack 5 polyfill errors?