kreait / laravel-firebase

A Laravel package for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
1.09k stars 174 forks source link

Permission denied on subscription #5

Closed Waqaralipk closed 4 years ago

Waqaralipk commented 4 years ago

Can you please let me know on subscription why I am getting permission denied error. While I am using Facades now instead of the factory. Here is an example of a sample code that I am using. Correct me if I am doing something wrong. I have assigned false validation rule on firebase because authentication is required there and how can I do authentication to using the admin-firebase laravel package. However, I didn't do any authentication when using a factory and it was working. One another thing, do we have support to use understand-delivery with that package?

Code:

use FirebaseMessaging, FirebaseDatabase;
FirebaseMessaging::unsubscribeFromTopic($topic, $tokensArray);

here is the snap of error
Screenshot from 2019-12-17 12-35-28

jeromegamez commented 4 years ago

Could you please update the issue? Your code formatting makes it really difficult to read. Please also format your code example. There is no need to @ me, I get notified about each comment.

That being said...

Have you configured the package and are you using the correct service account?

Do other operations work, or is it just this one?

Waqaralipk commented 4 years ago

Could you please update the issue? You posted almost everything in the title. Please also format your code example. There is no need to @ me, I get notified about each comment.

That being said...

Have you configured the package and are you using the correct service account?

Do other operations work, or is it just this one?

sure let me update

Waqaralipk commented 4 years ago

Could you please update the issue? Your code formatting makes it really difficult to read. Please also format your code example. There is no need to @ me, I get notified about each comment.

That being said...

Have you configured the package and are you using the correct service account?

Do other operations work, or is it just this one?

Yes, I have configured. The same service account was using before with the factory and it was working fine.

jeromegamez commented 4 years ago

The operation itself worked (that's why you get two results) - permission denied in this case means that the two tokens don't belong to the Firebase project of the Service Account.

Waqaralipk commented 4 years ago

The operation itself worked (that's why you get two results) - permission denied in this case means that the two tokens don't belong to the Firebase project of the Service Account.

Sounds good to me, it might be possible because I am testing from the local environment. What about understand-delivery can we use this delivery feature with this Laravel-firebase package?

jeromegamez commented 4 years ago

You can enable message delivery exports on a global and app-instance level by following https://firebase.google.com/docs/cloud-messaging/understand-delivery#bigquery-data-export - access to BigQuery to fetch this data is not part of the package or the SDK. I hope I'm understanding you correctly.

Waqaralipk commented 4 years ago

Okay thank you so much for your precious time

jeromegamez commented 4 years ago

You‘re welcome 🌺