AWS DataStore not working with API Key configuration - aws-amplify

Getting this warning Data won't be synchronized. No GraphQL endpoint configured. Did you forget Amplify.configure(awsconfig)? which I assume is the reason my data isn't being synced to the cloud and is only working locally while testing my application.
I have read many of the pasts posts about this issue and have followed all the steps such as configuring the endpoint url in aws-exports.js but nothing I'm finding online is working. Anyone have any success with this issue using API key as the default auth setting?

Related

Firebase adding web app doesn't work - err [Reason: Deleted account when looking up robot. AppIdentity::DELETED]

I have created an app in the testing project and all worked fine, now when I am trying to replicate it in the production project in Firebase, it's throwing the following error. I cannot seem to find anything related online. Any help would be appreciated. Thanks
error message
I am expecting to be able to add the web app into my project.
The Firebase support team has helped me to resolve this issue:
We need to override the bad OAuth client directly (the bad client may still exist, but will not be used for web apps anymore):
Create a new web OAuth client in Cloud Console with URIs and Authorized redirect specified (your project ID + firebaseapp.com)
In the Firebase console, Auth -> GoogleSignIn details -> Set the web client ID and secret from the new client
This worked for me.

How to Fix Permission Issues in Firebase Cloud Functions (Nextjs Experimental Hosting)

I have an issue related to Firestore, Hosting, and Cloud functions. I deployed a Nextjs application using the just-released experimental web framework support. I'm using Nextjs's Image API, and as expected, the Firebase CLI creates a cloud function for the project. Everything works fine at the start, but when I try to open a page in the application that reads some data from Firestore, it redirects to an auth page, which is unexpected.
Even when I auth with my Google account (since that's the logged-in user to the application), it returns a forbidden error and logs me out.
When I go back and try again, it returns a different error (most likely because I was logged out automatically).
I tried doing some research, and some people suggested adding an allUsers principal permission to Cloud functions, but that didn't work (Error: Principals of type allUsers and allAuthenticatedUsers cannot be added to this resource), and that's even insecure permission. Only authenticated users should be able to read data from the page as already configured in my Firestore security rules. So it's unclear what I need to do since Firebase created the Cloud function automatically or if this is related to my security rules and cloud functions.
What could be wrong? Everything works fine in my existing deployment setup to Netlify (where Edge functions are created automatically using their Nextjs plugin). I'm only trying to test the new Firebase web framework hosting features. Please let me know if you'd need me to provide some more context or debug files to better help you help me.
Thank you!
The message “ App requesting permission to access your google account “ pops up if the function runs in any region other than us-central1.
Currently, Firebase Hosting does not support Cloud Functions in any other regions, Except us-central1.
You can refer to this StackOverflow thread.

How to investigate errors in Firebase Remote Config API?

I see errors for the Firebase Remote Config API in the Google Cloud Console > API/Service Details metrics.
Looking at "Traffic by response code" I see that a specific API key is causing HTTP code 400 responses from the API for the method:
google.firebase.remoteconfig.v1.RemoteConfigService.FetchRemoteConfig
I'm not able to reproduce this issue locally so how can I find out more about these errors in the Google Cloud Console?
What I've checked so far:
The credential that is causing the errors is restricted to the correct package name and SHA-1 hash (hash taken from Google Play Console > App Integrity)
It's apparently not hitting a quota limit from looking at the quote graph
From the client side logs I only see the exception:
com.google.firebase.remoteconfig.g: The client had an error while calling the backend!
This is a standard error message used in the Remote Config SDK for a client error (ex: a connection timeout, SSL issue, etc.). I suggest that you double check your implementation. You could also use the Android network debugger to simulate the network calls, so it could create a handling mechanism to ensure that the actual device has a proper connectivity on doing the fetch.
You may also refer to the Stackoverflow post and the GitHub Link.
Google Developer Support pointed me to a known bug in the Firebase Remote Config library which has been fixed recently. Upgrading the library indeed fixed the issue.

Unable to call Firebase function from React.js application

I have a React.js application powered by a number of Firebase functions and real time database standing behind them. It has been working without any issue for the past 2-3 months and now I am getting a warning on the functions logs which says that:
#firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"Failed to parse access token response: Error: Server responded with status 404.\"."}
The way I initialize firebase from my React.js application looks like this:
I have double-checked everything standing behind process.env and it seems to be as expected. The website written in React.js in hosted under the Firebase hosting.
And this is how Firebase functions connect to Admin SDK:
I am not sure what would be the issue here. Nothing has changes in the code base from our side. Not sure if Firebase changed something internally that we need to consider.
What solved the issue for me was to go to the google cloud console (where Firebase functions are also available). Then I opened one of the failing cloud functions and I navigated to
My_Function_Name/Edit/RUNTIME, BUILD AND CONNECTIONS SETTINGS/RUNTIME SERVICE ACCOUNT/
And then I noticed there that for all of my functions it was selected App Engine Default Service Account instead of Firebase Admin SDK. I never explicitly set the runtime to this option. So, when I brought it back to Firebase Admin SDK the error was gone I was able to use the application once again.

Google Cloud functions access via https endpoint require site verification

I have a C# application that sends data to a firebase cloud functions https endpoint. This app has been working for a while until today. I get an error that the app now requires site verification. What do I need to do. If anyone has come across this and resolved, please help. I am still searching for solutions on stackoverflow

Resources