laravel-notification-channels / fcm

Firebase Cloud Messaging (FCM) notifications channel for Laravel
https://laravel-notification-channels.com/
MIT License
491 stars 126 forks source link

Partially Revert #64 to fix #69 #70

Closed ankurk91 closed 3 years ago

ankurk91 commented 3 years ago

@atymic

Let channel class to re-use Facade instead of resolving Messaging client from container.

This must fix the #69 .

I will find another way to mock this class.

Sorry for the trouble.

atymic commented 3 years ago

No worries. Just checking, sure this will fix the issue? ProjectId seems to be the binding that couldn't be resolved, but guess this is due to trying to resolve the client?

ankurk91 commented 3 years ago

Yes, this should fix the issue.

This PR reverts the code to good old way.

We were using Facades in old version.

The exception related to project id only appears when there is no credentials supplied to firebase sdk.

ankurk91 commented 3 years ago

Insights:

The messing client class can not be intanciated without a project id. The project id has to be retrieved from credentials (the json file)

When there is no credentials supplied/found, the binding failed. And container is unable to provide a instance of messeging client.

I will debug it more soon.