Skip to content
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

BadPushServiceProvider #241

Open
aaronvdbrugge opened this issue Feb 20, 2019 · 4 comments
Open

BadPushServiceProvider #241

aaronvdbrugge opened this issue Feb 20, 2019 · 4 comments

Comments

@aaronvdbrugge
Copy link

aaronvdbrugge commented Feb 20, 2019

What I did was:

  • Run curl addpsp from my Ubuntu console
  • From the app I called http://216.119.157.64:5400/subscribe and used WWW to add necessary forms ( it says it was a SUCCESS)
  • Then I run curl push from my Ubuntu console and get a BadPushServiceProvider.

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
Copy link
Contributor

TysonAndre commented Feb 20, 2019

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)

  • [WebFrontend] addr config is one way to limit access to only requests from localhost

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

@TysonAndre
Copy link
Contributor

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
Copy link
Author

aaronvdbrugge commented Feb 20, 2019 via email

@TysonAndre
Copy link
Contributor

TysonAndre commented Feb 20, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants