Firebase Analytics not working with web SDK installed on Expo app - firebase

I have firebase realtime database up and running with my expo app. I'm using the web SDL with the following code in my index.js file.
import * as firebase from 'firebase'
const firebaseConfig = {
apiKey: "XXXXXXXXXX",
authDomain: "XXXXXXXXXX",
databaseURL: "XXXXXXXXXX",
projectId: "XXXXXXXXXX",
storageBucket: "XXXXXXXXXX",
messagingSenderId: "XXXXXXXXXX",
}
firebase.initializeApp(firebaseConfig)
However no information is appearing in the analytics section of my firebase console dashboard. It says,
'Your Analytics data will appear here soon
We're ready to start collecting your Analytics data. Integrate the SDK, and within 24 hours you'll see your first reports.'
But have I not already integrated the SDK in my app with the code above? What am I missing here, is there some other link I need to make between the app and the dashboard?

Related

Trying to install firestore v.9 but credentials won't import

This part
const serviceAccount = require('./firestore-reactdb-027d52fa212f.json');
Results in an error:
Module not found: Error: Can't resolve './firestore-reactdb-027d52fa212f.json' in (...)
I downloaded the json file from IAM & admin > Service accounts in the Cloud Platform Console (as instructed here under "initialize on your own server"). I tried also to download the credentials from the console in firebase (project settings -> service account -> generate new private key).
PS: it's in a react app
Those credentials are needed when you make your own service. React app is not a service read about what service is. If you want to use firebase in react app you don't need those secrets. You need firebase config object and you no need to wory about to sharing it. This config object is necesery for firebase to know where he can send requests etc.
Example object with configurations for firebase.
const firebaseConfig = {
apiKey: "...",
authDomain: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "...",
appId: "...",
measurementId: "..."
};

Using React Native and Expo in VSCode, connectivity to Firestore on iOS not working

Error Stack
Possible Related Warning
When using expo with react my project runs fine on web and will access Firestore properly but when using iOS or iOS Simulators it will access firebase.auth() and use that correctly but says is unable to connect to Firestore.
Config File
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
const firebaseConfig = {
apiKey: "XXXXX",
authDomain: "XXXXX",
databaseURL: "XXXXX",
projectId: "XXXX",
storageBucket: "XXXX",
messagingSenderId: "XXXXX",
appId: "1:XXXXXX:web:XXXXXXX"
};
Might have something to do with appId being something: web: something
If more code is needed I can make a repository just thought since it works perfect on web it doesn't have to do with anything except firebase config.

Use Firebase Realtime Database in Flutter Web App

I'm a beginner in Flutter and I want to connect my Flutter Web App to Firbase Realtime Database. My goal is to add some sample data inside the database when I click a button.
At this moment I have added inside the web/index.html file the following
<script src="https://www.gstatic.com/firebasejs/7.20.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.20.0/firebase-firestore.js"></script>
<script>
var firebaseConfig = {
apiKey: "...",
authDomain: "...",
databaseURL: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "...",
appId: "...",
measurementId: "...",
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
In my pubspec.yaml file I have added the following dependencies:
firebase: ^7.3.2
firebase_core: ^0.5.2
firebase_database: ^4.3.0
My main.dart file contains a simple main() function like below
void main() {
runApp(MyApp());
}
And the MyApp() stateless widget.
Do I have to use the .initializeApp() and pass inside it the project's constraints (apiKey, authDomain etc.)?
Can someone give me some hints because i have no idea what to do, i'm pretty much confused at this moment.
Thank you for your time
If you look at the platform support table on firebase.flutter.dev, you'll see that the FlutterFire libraries don't support accessing Realtime Database in web apps yet. Work to add support is under way, but there's no estimate on when it will be released.
For the moment, if you want to use the Firebase Realtime Database in a Flutter web app, you'll have to use the firebase-dart library.

How can I initialize the Firebase Admin SDK in spring-boot application using kotlin

I would like to get data from Firebase. I found some tutorials, but all is using Google Credential ServiceAccount to initialize firebase app. this's is tutorial that i found :
https://medium.com/techwasti/spring-boot-firebase-crud-b0afab27b26e , and else tutorial i found, almost like that too, is using ServiceAccount.
But the problem is i cannot get the ServiceAccount from this firebase because it's from third party. that's mean the owner of firebase don't want to give ServiceAccount.json to me, but they give me firebase config to me, like this :
const firebaseConfig = {
apiKey: "apkey",
authDomain: authdomain",
databaseURL: "databaseurl",
projectId: "projectid",
storageBucket: "storragebucket",
messagingSenderId: "messagesenderid",
appId: "appid",
measurementId: "measurementid"
};
So, how can i initialize this firebase using kotlin in my java springboot aplication?
i had try to find the solution, but not found anything,
I would be glad for any help.
If you want to initialize the Firebase Admin SDK, you will need a service account. There are no alternatives for this.
The config for the front end web app that you're showing here will not work at all. That config is only used for frontend apps that are acting as clients on behalf of the end user.

Why don't I see the Firebase Web App API key?

Another app to add click > web click > Add a web app Firebase.
My situation
<script src="https://www.gstatic.com/firebasejs/3.4.1/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "",
authDomain: "********.firebaseapp.com",
databaseURL: "https://**********.firebaseio.com",
storageBucket: "********.appspot.com",
messagingSenderId: "*********"
};
firebase.initializeApp(config);
</script>
Go to Firebase Console. Select your app then you have your separated platform (ios, android) if ever you created two platforms already, if not, Click the additional settings from the upper right of the app, then click Manage. see image below:

Resources