Open shivani-ksolves opened 7 years ago
I'm facing a similar situation. Is there a way we can override the FCM::send server and sender keys?
I am also facing the same issue. I have two apps one for service providers and other for customers and it has to be the same Laravel backend/application.
Please sort this out and push an update. We will also need the steps to add multiple server keys and sender IDs. Thank You.
Hi everybody
My proposition is to use the pull request of henrique1977 (#52) But I would like to change it a bit to not modifying the config array.
Do you think that this implementation could be good for this issue ?
If yes I will integrate the pull request
Best Regards
What happened with this? Did henrique1977's fix this got integrated? It seems good for me.
I'm using this version of the codebase and it works like a charm
@solancer 👍 . Can you please update the document or links how you achieved with multiple senders(projects).
you can add condition according to your app
if(app=='1'){
//if you want to send notification to first app
config(['fcm.http.server_key' => 'your first app server key']);
config(['fcm.http.sender_id' => 'your first app sender id']);
}else{
//if you want to send notification to second app
config(['fcm.http.server_key' => 'your second app server key']);
config(['fcm.http.sender_id' => 'your second app sender id']);
}
@
you can add condition according to your app if(app=='1'){ //if you want to send notification to first app config(['fcm.http.server_key' => 'your first app server key']); config(['fcm.http.sender_id' => 'your first app sender id']); }else{ //if you want to send notification to second app config(['fcm.http.server_key' => 'your second app server key']); config(['fcm.http.sender_id' => 'your second app sender id']); }
It works like a charm! thx
you can add condition according to your app if(app=='1'){ //if you want to send notification to first app config(['fcm.http.server_key' => 'your first app server key']); config(['fcm.http.sender_id' => 'your first app sender id']); }else{ //if you want to send notification to second app config(['fcm.http.server_key' => 'your second app server key']); config(['fcm.http.sender_id' => 'your second app sender id']); }
Hi everyone @luolongfei @brozot I'm facing this issue....So this is the solution? but where I should put that condition? My case is that I use the same firebase server/console for several applications, so the server key would be the same, right? I would only change the sender_id I guess
any news on this?
@FutureFutureTo
I've created one repository for each app and just put this two lines above in php before FCM::sendTo of each repository:
config(['fcm.http.server_key' => env('FCM_SERVER_KEY')]); config(['fcm.http.sender_id' => env('FCM_SENDER_ID')]);
hey thanks for getting back to me on this...i actually just ended up using the firebase php sdk and rolling my own solution
I have multiple mobile apps (for each app I manage different server key and sender id) and I am using same laravel backend to send notifications to all different mobile apps. How can I send notification to different app using different sender id (not using single sender id) with laravel brozot package?