Closed tonespy closed 8 years ago
You have it wonky:
Server API Key
(Alpha-Numeric string)You get a 401 because your API key is incorrect.
@hypesystem If I have to obtain regIds from the device, wouldn't that be another problem? Cause, then I've to get IDs of every device I install my app before I can send them PUSH? But, from what I think, I think the reg ids is/are the Project-Number on Developer Console. Cause, I notice that's what is used to generate token on the device.
You have to get registration ids of every device you install your app on. That is how GCM works.
Yeah. Just thought it through too. Thanks.
How to get Registration id for phonegap-plugin from cordova
Hi @SanjanaTailor, Please consult StackOverflow or the phonegap-plugin-push documentation, your question is out of the scope of this project.
I'm getting a 401 error. I am kind of confused with the Naming Conventions though. Expecially the
var regIds = ['YOUR_REG_ID_HERE']; and var sender = new gcm.Sender('YOUR_API_KEY_HERE');
This is what I think.
API_KEY
in sender is the 10digitProject number
given to you by google. andregIds
is/are the Alpha-Numeric long String calledServer API Key
. I don't know what to debug since it's given 401 which meansUnauthorized Access
. But, this is what I'm doing I'm setting it up first on my sails/node app, but haven't set the mobile app to receive notification. But, that shouldn't return401
. Any help would be appreciated. Thanks