HTTP response code 401 in Google GCM

前端 未结 3 1690
迷失自我
迷失自我 2020-12-20 14:45

Below is the exception I am getting even though my API key for server and browser application are valid. I checked it using curl. I send GCM request in both format UTF-8 and

3条回答
  •  情歌与酒
    2020-12-20 14:54

    Please follow as par below instruction it's may help you.

    Update: It would also seem that Migrating from GCM to FCM fixes the issue for 401 Unauthorized Error.

    If you are just starting to use GCM, instead of creating a project in the Google Developers Console, do it in the Firebase Console. After creating the project, simply use the auto-generated Server Key. Here are the steps where to find the Server Key:

    1. Go to your Firebase Console and click on CREATE NEW PROJECT.
    2. Fill in your desired Project Name and select your Country. After this, the new Project should be active.
    3. Then on left-side panel, click on the gear button and select Project Settings.
    4. Then go to the Cloud-Messaging Tab.

    For old GCM projects, you can simply Import the project to the Firebase Console:

    1. Go to your Firebase Console and click on IMPORT PROJECT.
    2. Select the project you want to import and your country.
    3. Click on ADD FIREBASE. After this, the new Project should be active.
    4. Then on left-side panel, click on the gear button and select Project Settings.
    5. Then go to the Cloud-Messaging Tab.

提交回复
热议问题