Comments (10)
Hmm, here are my imports for the working capacitor v2 implementation where I got that screenshot:
import { Plugins } from "@capacitor/core";
import "@capacitor-community/firebase-analytics";
const { FirebaseAnalytics } = Plugins;
It looks like your first implementation may not have been working because you were not also importing "@capacitor-community/firebase-analytics" - you need that import because it actually exports all of the definitions for the plugin via export * from './definitions'
import { Plugins } from '@capacitor/core';
const { FirebaseAnalytics } = Plugins;
The new style you show is only for capacitor v3, so I would not use that unless you are upgrading:
# Capacitor V3 only
import { FirebaseAnalytics } from '@capacitor-community/firebase-analytics';
from firebase-analytics.
@brownoxford Importing import "@capacitor-community/firebase-analytics";
solved the issue! Thank you. Will close the issue now.
from firebase-analytics.
Same issue here, just started with the plugin and can't get any TypesScript support in VSCode.
Did you find a solution?
from firebase-analytics.
Nothing, this repo seems not being actively maintained.
from firebase-analytics.
Yeah, I think so. The Crashalytics Repo seems also to be outdated. I am fine without code insight, but I am worried about the maintenance of the plugins.
from firebase-analytics.
Same here, but with many community Plugins
Edit:
I know that generating a Plugin generates Types (definitions.(d.)ts) but VSCode seems to not recognise them as it is implemented with
declare module '@capacitor/core' {
interface PluginRegistry {
...
}
}
Maybe this is the Problem that VSCode is not able to read those informarions
from firebase-analytics.
It's been a couple of months since the last comment. Has anyone found any kind of progress here? Any custom definitions being used in the wild?
from firebase-analytics.
This seems to be working since the 0.2.0 release, are you still having this problem?
from firebase-analytics.
I see this repo is starting to come alive. Many thanks @brownoxford for this!
Your comment made me try different builds and different aproaches. I was already on 0.2.0 release, I tried 0.2.1 but still no luck.
Then I tried changing way how the package is imported.
Importing this way worked:
import { FirebaseAnalytics } from '@capacitor-community/firebase-analytics';
The problem occurs when we import package as recommended by Capacitor docs:
A common mistake is to import a plugin directly, then use the plugin API immediately, resulting in the web implementation being used:
By using the plugins from the plugin registry (Plugins object), the native implementation of the plugin is used (if available), with fallback to the web version.
import { Plugins, Capacitor } from '@capacitor/core';
const { FirebaseAnalytics } = Plugins;
Not sure as to how manage getting code insight with this approach.
from firebase-analytics.
@michalsisak did the updated import fix the issue for you?
from firebase-analytics.
Related Issues (20)
- Implementation of setDefaultEventParameters HOT 3
- Capacitor 5 HOT 2
- Play Console Error : Manifest doesn't include Advertising ID permission HOT 2
- Expose setUserProperties to set multiple user properties at once
- Disable auto tracking screen_view on web, but still allow events
- No App Version in analytics since update to 5.0 HOT 1
- In_app_purchase and version log when using @capacitor-community/firebase-analytics HOT 2
- XCode 15 build failed - DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead HOT 1
- No data are visible in the firebase analytics console in localhost HOT 1
- Consent management HOT 4
- Android not tracked
- [IOS] [FirebaseAnalytics][I-ACS013000] Screen parameter value must be of type NSString: (nil) HOT 2
- In app purchases not reported from Android HOT 1
- [FEATURE]: Add required `Privacy Manifest` file for iOS HOT 5
- Question about the screen_view
- Question about the GDPR and the user consent
- Please update this plugin to support capacitor 6 version HOT 1
- Compatibility with @capacitor/core 6.0.0 HOT 1
- ERROR Error: Uncaught (in promise): Firebase analytics is not initialized. Make sure initializeFirebase() is called once HOT 1
- Using the latest version of the SDK for IOS HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-analytics.