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

[messaging/unknown] The operation couldn’t be completed. Too many server requests. #4763

Closed
sidsingh760 opened this issue Jan 12, 2021 · 3 comments
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report

Comments

@sidsingh760
Copy link

sidsingh760 commented Jan 12, 2021

Issue

Error message - [messaging/unknown] The operation couldn’t be completed. Too many server requests.

I have get error message when i try to get token in firebase method messaging().getToken().
In simulator get token but in real device I have get Too many server error message.

Code
requestNotifications(['sound', 'badge']).then(
async ({status, settings}) => {
if (status === RESULTS.GRANTED) {
const authorizationStatus = await messaging().requestPermission();
if (authorizationStatus) {
messaging()
.getToken()
.then(async (token) => {
alert(token);
console.log('Permission status:', authorizationStatus);
})
.catch((err) => {
console.log(err);
debugger;
});
}
// Get the token
}
},
);

@sidsingh760 sidsingh760 added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Jan 12, 2021
@mikehardy
Copy link
Collaborator

Hi there!

You ignored the template, so this issue will be summarily closed.

The error message is explicit, look for ways to reduce your messaging API request throughput.
Never test messaging on simulator or emulator, use real devices as the simulator and emulator both may perform differently then real devices and the simulator (which is a specific word and implies iOS) does not support messaging and tokens at all
While using real devices connected to your computer watch debug logs (Xcode console or adb logcat)

@codoffer
Copy link

codoffer commented Mar 3, 2022

I have solved this issue by configuring Google CloudAPIs.

  1. Login with Google Cloud
  2. Choose Project
  3. Choose APIs keys (Added by firebase) and configure
  4. Add application restriction and set restrict key (Firebase Installation and other APIs, if you want - By Dropdown)

@PeterGreshnov
Copy link

I have solved this issue by configuring Google CloudAPIs.

  1. Login with Google Cloud
  2. Choose Project
  3. Choose APIs keys (Added by firebase) and configure
  4. Add application restriction and set restrict key (Firebase Installation and other APIs, if you want - By Dropdown)

Cause and fix have been confirmed in my case as well: the API key "iOS key (auto created by Firebase)" was misconfigured. Fixing key configuration in Google Cloud Console fixed the issue in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report
Projects
None yet
Development

No branches or pull requests

4 participants