i was using expo react native
ive install the firebase package using npm install --save @react-native-firebase/app
i also install the package im using @react-native-firebase/analytics
the issue is when ever i try to use this i got error
<code><Button
title="Add To Basket"
onPress={async () =>
await analytics().logEvent('basket', {
id: 3745092,
item: 'mens grey t-shirt',
description: ['round neck', 'long sleeved'],
size: 'L',
})
}
/>
</code>
<code><Button
title="Add To Basket"
onPress={async () =>
await analytics().logEvent('basket', {
id: 3745092,
item: 'mens grey t-shirt',
description: ['round neck', 'long sleeved'],
size: 'L',
})
}
/>
</code>
<Button
title="Add To Basket"
onPress={async () =>
await analytics().logEvent('basket', {
id: 3745092,
item: 'mens grey t-shirt',
description: ['round neck', 'long sleeved'],
size: 'L',
})
}
/>
by clicking it i got this error : Error: No Firebase App ‘[DEFAULT]’ has been created – call firebase.initializeApp()
same thing from their documentation but is not working
<code>import react, { useEffect } from 'react';
import { View, Button } from 'react-native';
import analytics from '@react-native-firebase/analytics';
function App() {
return (
<View>
<Button
title="Check analy"
onPress={async () =>
await analytics().logSelectContent({
content_type: 'clothing',
item_id: 'abcd',
})
}
/>
</View>
);
}
</code>
<code>import react, { useEffect } from 'react';
import { View, Button } from 'react-native';
import analytics from '@react-native-firebase/analytics';
function App() {
return (
<View>
<Button
title="Check analy"
onPress={async () =>
await analytics().logSelectContent({
content_type: 'clothing',
item_id: 'abcd',
})
}
/>
</View>
);
}
</code>
import react, { useEffect } from 'react';
import { View, Button } from 'react-native';
import analytics from '@react-native-firebase/analytics';
function App() {
return (
<View>
<Button
title="Check analy"
onPress={async () =>
await analytics().logSelectContent({
content_type: 'clothing',
item_id: 'abcd',
})
}
/>
</View>
);
}