laravel-firebase icon indicating copy to clipboard operation
laravel-firebase copied to clipboard

Config to disable Cloud Messaging

Open fabiomlferreira opened this issue 2 years ago • 2 comments

I'm having a problem, I have a project that is already in production, and I'm working in the development project but I don't have a easy way to disable the Cloud Messaging to prevent to spam real clients.

The only solution that I found is to create a second firebase account and use that credentials but I think we should have a config for .env to disable Firebase, for example FIREBASE_ENABLED=false.

fabiomlferreira avatar Nov 05 '21 09:11 fabiomlferreira

Feel free to make a PR

devglrd avatar Apr 14 '22 09:04 devglrd

I think a PR won't help 😅. Having a separate Firebase project is currently the recommended (only) way to do it with the PHP SDK, and was the only way to do it before Google released the emulator suite. Support for the emulators will come eventually, but I can't tell you when.

Perhaps I will be able to add a NOOP implementation before that, but I'm currently on vacation and don't know when I'll have the resources for it, so I don't have an ETA for that either.

jeromegamez avatar Apr 14 '22 10:04 jeromegamez

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let me know if that works for you by leaving a 👍. Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Sep 23 '22 08:09 github-actions[bot]

One can use the Laravel events

 \Illuminate\Notifications\Events\NotificationSending::class => [
            \App\Listeners\Notification\PreventFCMWhenDisabled::class,
        ],

ankurk91 avatar Jan 17 '23 05:01 ankurk91

I'm closing this issue because using a separate project remains the only way to do it with the SDK. It now has support for the Emulator Suite, but there's no emulator for FCM (yet).

I haven't tested if/how @ankurk91's suggestion works, but perhaps the can elaborate so that you can implement this as well.

jeromegamez avatar Jun 10 '23 23:06 jeromegamez