react-native-firebase
react-native-firebase copied to clipboard
Firebase Analytics/perf with One signal conflict[🐛] Bug Report Title - CHANGE ME
Issue
Here's my problem, when installing firebase with analytics and perf everything perfectly fine, some Events are logging. I tried to use the debug view for testing purpose but on my real project it wouldn't trigger for some reason, so i made a fresh project with the same version of react native and firebase as my project. Everything was working even the debug view. so at this point i knew it was a conflict in my project.
Once i installed One signal package on the fresh project my debug view stopped working and also firebase/perf stopped working. i can see some
2022-09-16 08:07:15.023390-0400 rabaischocstesting[13120:159478] [boringssl]
boringssl_metrics_log_metric_block_invoke(153) Failed to log metrics
Project Files
Javascript
Click To Expand
``` import React from 'react'; import analytics from '@react-native-firebase/analytics'; import perf from '@react-native-firebase/perf'; import {Pressable, Text} from 'react-native';
const tracePerf = async () => { // Define & start a trace const trace = await perf().startTrace('custom_trace');
// Define trace meta details trace.putAttribute('user', 'abcd'); trace.putMetric('credits', 30);
// Stop the trace await trace.stop(); };
const logEvent = async (event, param) => await analytics().logEvent(event, param);
const App = () => { const [count, setCount] = React.useState(0);
const pressableStyle = { width: ' 100%', height: 500, backgroundColor: 'yellow', }; const textStyle = {fontSize: 55};
React.useEffect(() => { console.log('toto');
tracePerf();
}, []);
return ( <> <Pressable onPress={async () => { console.log('on_yellow_cube_press');
setCount(count + 1);
await logEvent('on_yellow_cube_press', {
description: 'pressed yellow cube',
testId: count,
});
}}
style={pressableStyle}
/>
<Text style={textStyle}>{count}</Text>
</>
); };
export default App;
#### `package.json`:
```json
{
"name": "rabaischocstesting",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-firebase/analytics": "^14.11.0",
"@react-native-firebase/app": "^14.11.0",
"@react-native-firebase/perf": "^14.11.0",
"react": "17.0.2",
"react-native": "0.67.3",
"react-native-onesignal": "^4.4.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
firebase.json for react-native-firebase v6:
# N/A
iOS
Click To Expand
ios/Podfile:
- [ ] I'm not using Pods
- [x] I'm using Pods and my Podfile looks like:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
target 'firebasedemo' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
target 'firebasedemoTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
# N/A
AppDelegate.m:
// N/A
Android
Click To Expand
Have you converted to AndroidX?
- [ ] my application is an AndroidX application?
- [ ] I am using
android/gradle.settingsjetifier=truefor Android compatibility? - [ ] I am using the NPM package
jetifierfor react-native compatibility?
android/build.gradle:
// N/A
android/app/build.gradle:
// N/A
android/settings.gradle:
// N/A
MainApplication.java:
// N/A
AndroidManifest.xml:
<!-- N/A -->
Environment
Click To Expand
react-native info output:
OUTPUT GOES HERE
- Platform that you're experiencing the issue on:
- [ ] iOS
- [ ] Android
- [ ] iOS but have not tested behavior on Android
- [ ] Android but have not tested behavior on iOS
- [x] Both
react-native-firebaseversion you're using that has this issue:e.g. 5.4.3
Firebasemodule(s) you're using that has the issue:e.g. Instance ID
- Are you using
TypeScript?Y/N&VERSION
- 👉 Check out
React Native FirebaseandInvertaseon Twitter for updates on the library.
So, if I understand correctly, react-native-firebase analytics+perf are working great. And then if I understand correctly, OneSignal stops them from working.
I'm not sure what actionable thing I can take from that report? It sounds like OneSignal is doing something unexpected? I don't use OneSignal nor can I troubleshoot them. I can reproduce and work on react-native-firebase issues
Also this is not on current versions - I understand v15 may be uncomfortable to use but reproductions must be on current versions.
Yes your understanding of the problem is correct,
I've also opened an issue on One signal side, i was not so sure where to post the issue since one signal make it stop working but it is also related to Firebase. I've seen conflict over the forums on those 2 repo but couldn't find one similar to my problem so i decided to make one as good as i could.
Thanks for your answer, really quick.
Thanks for your answer, really quick.
I do try ;-), when I'm not on vacation anyway. If there's something that react-native-firebase is doing that is not correct, of course we can take adjust something, but the hard part will be figuring out exactly what. Now this part is vague: but in the past one the problem was dependency conflicts and our take on it was that OneSignal was either not up to date or not handling it well, and in the end we just had a documented workaround. Here's the result of that: https://notifee.app/react-native/docs/integrations/onesignal - so my general take is that it's probably on the OneSignal side but a) software is hard, that's not an insult or anything and b) it's a single data point. So, could be wrong.
I will be curious for any results from other there, or if there's something we can do. Cheers
I will be curious for any results from other there, or if there's something we can do. Cheers
No problem, i do understand that it can be hard to pin-point the right problem. I will see with One signal about this problem and if i get an answer and it work, i will come post it here.
Hello 👋, to help manage issues we automatically close stale issues.\n\nThis issue has been automatically marked as stale because it has not had activity for quite some time.\nHas this issue been fixed, or does it still require attention?\n\n> This issue will be closed in 15 days if no further activity occurs.\n\nThank you for your contributions.