decision-labs / fcm

Ruby bindings to Firebase Cloud Messaging (FCM) for Android, iOS or Web
MIT License
510 stars 153 forks source link

alternate firebase server for testing? #78

Closed mcr closed 3 years ago

mcr commented 4 years ago

Is there a way to use the firebase emulator locally for use with testing?

sabman commented 4 years ago

Have you looked into VCR [1]? If you get it working please share your experiences. [1] https://github.com/vcr/vcr

mcr commented 3 years ago

Hi, I mucked around with VCR. I hadn't used it before, having stuck to stub_request() in my system.

VCR would be better because it would get more of the detail, but one would probably wind up having to run it against a real smartphone to get the right tokens in. In manual testing, I've run my app on the emulator, with a bunch of hard to repeat (and impossible to CI) plumbing to get it connected to my rails app.

There is a firebase emulator that one can download and run under nodejs, and I have it running, but I didn't quite figure out how to use it all. I need a way to get the end-system token into the test system (rspec in my case) to simulate the smartphone system, and I need to then see it round trip to act on the notification. Using fcm is pretty easy, but there are so many thiings that could go wrong that I'd like to test.

sabman commented 3 years ago

@mcr did you manage to make headway on this?

mcr commented 3 years ago

@mcr did you manage to make headway on this?

nope. As far as I could tell, the emulator was for storage uses of FCM only, not messaging.