uniqush / uniqush-push

Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.
http://uniqush.org
Apache License 2.0
1.53k stars 201 forks source link

BadPushServiceProvider #241

Open aaronvdbrugge opened 5 years ago

aaronvdbrugge commented 5 years ago

What I did was:

Can you see from the Console log what the issue is?

[removed]

Here's the return statement from calling subscribe. As you can see it says SUCCESS

[removed] I open a new issue because the other one was closed before I could reply and I think notifications are turned off when an issue is closed so no one would look at it again.

Edit:

http://216.119.157.64:5400/subscriptions returns [] So there's no subscribers. How is that possible? When I call http://216.119.157.64:5400/subscribe from the app I get, as you can see, SUCCESS message. So what is going wrong?

Edit 2:

Just to confirm, when running addpsp for FCM the Project ID is this:

image

And the API key is this?

image

I'm only asking because this stuff seems more important but it's not mentioned in the documentation:

image

TysonAndre commented 5 years ago

I'm guessing you have the wrong project id or apikey. Double check https://firebase.google.com/docs/android/setup#manually_add_firebase .

  1. Check uniqush's output log file for more details on any errors
  2. BadPushServiceProvider means that FCM is saying the server key or project id you provided is invalid. I'm pretty sure you should use "Server key", not "Legacy server key"
  3. Check that you copied the full key with the correct upper/lower casing, etc. Although "Legacy server key" worked the last time it was tried, google recommends moving to the regular "server key"

Also, uniqush-push setup recommends not setting it up on the public internet (e.g. use a firewall, only allow access to it from your server-side application after verifying that the credentials are correct (for the admin sending out pushes, for logged in users subscribing, etc)

Also, the api key should be changed; it's in the console screenshots

TysonAndre commented 5 years ago

Also, this isn't an issue with uniqush-push; this is an issue with how you've configured uniqush. Other applications implementing push services would also fail given the same configuration.

Make sure that https://firebase.google.com/docs/cloud-messaging/android/first-message works; make sure that the project id and api key matches that

aaronvdbrugge commented 5 years ago

Hi Tyson,

Thank you for the reply. I did manage to send a notification to myself using Firebase but I was using a remote server I hosted on my laptop.

Just to confirm, the "apikey" field is supposed to be the Server key?

[image: image.png]

I also think I should be adding the Firebase server key but I don't see any field for it. That's why I left it out. Is apikey the Server key and the actual Firebase API key is not needed?

Thanks again.

Sincerely / Met vriendelijke groeten, Aaron van der Brugge

On Wed, Feb 20, 2019 at 3:09 PM Tyson Andre notifications@github.com wrote:

Also, this isn't an issue with uniqush-push; this is an issue with how you've configured uniqush. Other applications implementing push services would also fail given the same configuration.

Make sure that https://firebase.google.com/docs/cloud-messaging/android/first-message works; make sure that the project id and api key matches that

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/uniqush/uniqush-push/issues/241#issuecomment-465589898, or mute the thread https://github.com/notifications/unsubscribe-auth/ArOs292geGsXTH25-6qsuyb57VAkl6Zgks5vPVcggaJpZM4bExTe .

TysonAndre commented 5 years ago

Yes, the apikey field should be the Server key

[image: image.png] is not showing up as an image

"Web API KEY" is not used by Uniqush. It is used by Firebase's WEB APIs (which are not used by uniqush - just sending pushes)

https://firebase.google.com/docs/reference/rest/auth/

This was mentioned in the documentation for addpsp https://uniqush.org/documentation/usage.html#adding-push-service-provider

Note: you need to make a Server key not an Android key.