Closed DeDuckProject closed 7 years ago
@DeDuckProject where did you add your ip? In the "key restriction" of the api key? How did you enter your development server?
In key restriction i changed to IP and added the server IPs
@DeDuckProject thanks. But didn't work for me. I ended up using an old key. This one was created before google changed to FCM. I don't know if this is the reason.
@Hitabis yes you are right. It first worked for me when I used the old key. and then I did what I wrote :)
I had this same problem and this is due to poor documentation by Google and Firebase teams. You can't use the key created in the Google Developers console. You must import your project into a Firebase project and use the GCM key they provide there.
We had to use the Web Api Key found in Project Settings and not the Server Key found under Cloud Messagin.
Edit: I solved it as follows: Apparently GCM changed the way you create API keys. They no longer let you choose between server, browser, etc.. But I think their default doesn't whitelist all IPs so once I explicitly added my local public IP and my server's public IP I stopped getting this error.
Hi, I'm trying to send a push using the default GCM adapter. I get an 401 error. My server config is configured ok, I know this because the correct apiKey is used when needed in the adapter (when I'm debugging).
What I find strange, is that in no place, the senderId is used
on init this code is executed:
args holdes the proper apiKey and senderId but the senderId is disregarded and the
this.sender
only takes the apiKey. I've not found any code use for senderId.I'm running parse-server version 2.2.17
note that I've noticed that google API changed their API key usage a bit, and not instead of choosing between ios,server, browser or android - the default is simply creating a non-restricted API key, which is what I did. Triple checked the API key, and generated new ones and tried them as well... Waited 5 minutes. and then that 401 error.
Anyone have a clue or direction?