Nodejs-pubsub: How do I use PubSub with react native?

Created on 13 Sep 2019  路  4Comments  路  Source: googleapis/nodejs-pubsub

Hi ,
I am using @google-cloud/pubsub in react native ,
yarn add @google-cloud/pubsub
when trying to use getting error ,

node_modules/@google-cloud/pubsub/build/src/subscription.js: Moduleevents` does not exist in the Haste module map

pubsub help wanted question web

All 4 comments

馃憢 @sombizbuzzz this module was built specifically for Node.js, so I'm not too sure how difficult it would be to get running in a react native application. It would appear that it does not have support for core Node.js modules (like events) so you'll probably need to shim it.

Yes, I understand your comment. Thank you guys for comment for my issue :)

@saeromCho This was brought up today during a meeting. I'm not sure if the specific suggested architecture in this is useful for you, but it's an example of how you might use Pub/Sub from mobile?

https://cloud.google.com/solutions/setting-up-a-pubsub-proxy-for-mobile-clients-on-gke

(Would also apply to a downloaded client on a PC, I'd guess.)

I'm going to go ahead and close this out, because I think the actual answer is that we don't really officially support it, and the proxy is probably the encouraged solution. Feel free to add comments though, if you find a better solution!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidtom picture davidtom  路  3Comments

codyzu picture codyzu  路  8Comments

vongohren picture vongohren  路  3Comments

feywind picture feywind  路  7Comments

steffiisawesome picture steffiisawesome  路  8Comments