-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FCM HTTP V1 service #171
base: master
Are you sure you want to change the base?
Conversation
Hi, |
@dragermrb Thanks for the solution. We are using your fork. Just wanted to leave a comment here. I know that main project does not allow to use multiple fcm api keys with config structure, but that can be dealt with by using |
I have overwritten |
Any plans to merge this ? |
is this PR will be merged soon ? |
Hi thanks for your contribution here. I will have a look at this next weeks and will prepare a release for that. |
how much time it will take to fix? |
@dragermrb I think you need to update your FCMV1Channel class to include the buildData method, your code currently doesn't work when using the FCM Channel in Laravel Notifications. The google API returns errors for the request keys that are no longer valid (sound, color, etc) this is my custom channel class that works for me |
Class |
hi @dragermrb yes but because the buildData method there is including the 'sound' and 'color' fields in the request the Google API is returning an error as they aren't supported anymore I believe. I'll post the error response from the API later today. |
All these keys al valid according to documentation: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages?hl=es#AndroidNotification |
@dragermrb it looks like those keys are only valid in the 'android' key of the request though, currently it's including them in the base notification object so it's giving that error https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages?hl=en#Notification |
The problem only occurs when using Laravel notifications. Since I don't use them I couldn't reproduce the problem. I need to do some work to correctly generate the payload from an instance of I'll post the changes when I have a chance. |
Thanks @dragermrb one other thing I noticed was the status codes here. I think this should only be a 404 status code. I was using the unregistedDeviceTokens to remove any invalid tokens for my users and including the 400 status code here means that if I send any invalid request parameters my tokens will be deactivated even if they are valid. From the docs it looks like 404 is correct to me for detecting deactivated device tokens. |
Add service to use FCM HTTP v1 API.
According to Google (https://firebase.google.com/docs/cloud-messaging/migrate-v1)