Closed abdullahizzuddiin closed 3 years ago
as mentioned on #3879 I'm also seeing same issue, anything I can do to help please let me know!
Hi @rossjohnsonMP , thank you for you willing to help.
Do you have any idea/step/trick to do so my ios crash report can appeared on Firebase Console?
@abdullahizzuddiin that was more aimed at collaborators or maintainers, I can't help you as I'm in the same position :)
Please confirm these things https://github.com/invertase/react-native-firebase/issues/3879#issuecomment-676966635
use 8.3.2 version or higher
verify you have a firebase.json in your project - empty if it needs to be (separate issue logged)
your firebase.json is well-formed JSON, parsing errors will cause silent failure (separate issue logged)
have the correct keys set for disabling the auto disabler, etc like this perhaps:
{
"react-native": {
"crashlytics_disable_auto_disabler": true,
"crashlytics_debug_enabled": true
}
}
run npx react-native-clean-project to make sure you are squeaky clean for your build
build it and make sure the dSYMS are uploaded
crash it and then restart the app
wait a little bit and see ? crossed_fingers
For everyone that has confirmed all those things, we get a report of success.
I followed your suggestion step by step:
firebase.json
file's content
{
"react-native": {
"crashlytics_disable_auto_disabler": true,
"crashlytics_debug_enabled": true
}
}
node_modules
, pod
dir, build
dir. I also did Product -> Clean before build../upload-symbols -gsp ../../GoogleService-Info.debug.plist -p ios ../../../../../AppName.app.dSYM/
Log appeared on console after my build finished and ran the app.
[Firebase/Crashlytics] Version 4.4.0
[Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iPhone9,3, 13.7.0 (17H35)
[Firebase/Crashlytics][I-CLS000000] Root: /var/mobile/Containers/Data/Application/13ADBD41-9A35-40B2-8C5D-774013038616/Library/Caches/com.crashlytics.data/id.AppName.debug
[Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Registered Firebase Analytics event listener
[Firebase/Crashlytics][I-CLS000000] Automatic data collection is enabled.
[Firebase/Crashlytics][I-CLS000000] Unsent reports will be uploaded at startup
Then, I tried to built again. This log appeard on console.
[Firebase/Crashlytics] Packaged report with id 'dc5d9933e4c541c8a2f6ff7c6693713a' for submission
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Preparing the report for the new endpoint: 1
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Submitting report
0 Flip[617:178559] 6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Sending event.
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Completed report submission with id: dc5d9933e4c541c8a2f6ff7c6693713a
6.30.0 - [Firebase/Performance][I-PRF100009] Logging network request trace - https://crashlyticsreports-pa.googleapis.com/v1/firelog/legacy/batchlog, Response code: 200, 1568.5920ms
6.30.0 - [Firebase/Performance][I-PRF100009] Logging network request trace - https://crashlyticsreports-pa.googleapis.com/v1/firelog/legacy/batchlog, Response code: 200, 1568.9490ms
Even though log Completed report submission
is exist, there is still no crash report appeared on my console.
For more context, I used Crashlytics since it still owned by Fabric. I've removed all code/config (fabric ID, Fabric run script, react-native-fabric/SMXCrashlytics)
Dang, with that "Completed report submission", it seems like it all worked right? I mean, what else can we do :sweat_smile: - hopefully it is just a lag in reporting? There was one person that reported it took 15 hours once!?!
Fantastic that you grabbed those logs though, I think they show everything is actually working.
One thing I'll note (though let me say I do not think it is important here) is that npx react-native-clean-project
does a lot more than you did. A whole lot more! It cleans Derived Data for iOS builds plus watchman and metro bundler caches and things. Each of those has caused problems in my experience, and given your logs above saying it submitted a report even I don't think it matters now, but it is something to keep in mind
I suspect this is caused by fabric migration.
On 6.4.0 version, crashlytics (android and ios) worked wonderfully.
on 7.* version, rnfb/crashlytics migrated to firebase/crashlytics.
And I upgraded from 6.4.0 to 8.4.2.
Maybe there is something wrong on my fabric migration. Any clue?
I am not sure, it is possible to raise this with the firebase-ios-sdk repo. They do not readily take on issues when react-native-firebase is in use, but if you did a quick reproduction with your firebase credentials plist and a minimal amount of objective-c code that showed the problem you should be able to get attention (they probably have an example you could quickly clone and try?). There are other Fabric customers that reported an inability to see reports after migrating and I don't believe anyone has reported a resolution for it yet
I've also generate new main.bundlejs. Old main.bundlejs still have code/configuration related to fabric.
It still didn't worked.
= = =
anyone has tried to abandon old firebase project, and new fresh project with no fabric migration inside?
what problem will be potentially occurred?
exactly same issue here
Hi @wddwycc, Would you post your detailed condition?
@abdullahizzuddiin @mikehardy
migrating from 6.4.0 to 8.4.2, enabled crashlytics_disable_auto_disabler
and crashlytics_debug_enabled
, enabled -FIRDebugEnabled
for verbose log, using crashlytics().crash
to trigger crash, got:
14:35:40.571 Staging [Firebase/Crashlytics] Packaged report with id '1cb2d91439df4d3294f1ee005c341f63' for submission
14:35:40.585 Staging 6.30.0 - [Firebase/Crashlytics][I-CLS000000] Preparing the report for the new endpoint: 1
14:35:40.588 Staging 6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Submitting report
14:35:40.601 Staging 6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Sending event.
14:35:40.635 Staging 6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Completed report submission with id: 1cb2d91439df4d3294f1ee005c341f63
The log says report completed, but nothing in my firebase dashboard (by the way, android works perfectly)
@abdullahizzuddiin @mikehardy
This Completed report submission with id
log is from firebase-ios-sdk, so I doubt the issue is relevant to firebase server. I sent a ticket to the firebase team, it takes 2 business days for them to respond, let's see
What a coincidence. I also sent a ticket to firebase support.
Thanks @wddwycc
Firebase support team has answered my ticket and they refused to check because I'm using 3rd party library --not directly using Firebase/Crashlytics
I choose my words carefully @abdullahizzuddiin
They do not readily take on issues when react-native-firebase is in use, but if you did a quick reproduction with your firebase credentials plist and a minimal amount of objective-c code that showed the problem you should be able to get attention (they probably have an example you could quickly clone and try?).
https://github.com/firebase/quickstart-ios/blob/master/crashlytics/README.md
Same here. I spent a lots of time and no success. I followed everything that has been mention here except the part upload-symbols.
Likewise. Not uploading symbols should not prevent crashes appearing.
I did try this : https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports to upload manually. I ran this command :
ios/Pods/FirebaseCrashlytics/upload-symbols -gsp ios/MyApp/GoogleService-Info.plist -p ios ios/MyApp.app.dSYM.zip
I'm gonna wait a few hours to see if it appears, otherwise I'm lost.
Let me release the current work really quickly - it has been merged but not released. Update your crashlytics in about 30 minutes to the version I will generate and it may help. Adding -FIRDebugEnabled to your launch arguments in your build scheme in Xcode may be illuminating as well
Let me release the current work really quickly - it has been merged but not released. Update your crashlytics in about 30 minutes to the version I will generate and it may help. Adding -FIRDebugEnabled to your launch arguments in your build scheme in Xcode may be illuminating as well
Thanks for the help, I’ll check it when it’s out.
Thanks for the help, but unfortunately, it doesn't seem to work :/ Is it supposed to work in debug mode ?
My firebase.json:
{
"react-native": {
"crashlytics_debug_enabled": true,
"crashlytics_auto_collection_enabled": true,
"crashlytics_disable_auto_disabler": true
}
}
My versions :
{
…
"@react-native-firebase/analytics": "^7.6.2",
"@react-native-firebase/app": "^8.4.2",
"@react-native-firebase/crashlytics": "^8.4.4",
"@react-native-firebase/messaging": "^7.8.6",
…
}
I've been looking so long at the Add the Firebase iOS SDK (4.3.0 or higher) or Unity Plugin (6.15.0 or higher), then build, run, and crash your app
message I'm almost hypnotized.
Adding -FIRDebugEnabled to your launch arguments in your build scheme in Xcode may be illuminating as well
Definitely do this, it (along with a step you need to take in order for it to work with a debugger attached) are detailed here https://firebase.google.com/docs/crashlytics/test-implementation?platform=ios
I have to admit I find it easier to TestFlight a release build personally, but that's for ongoing testing, I understand during initial implementation debug crashes are quite useful
I found a solution !! So I realized that on another project of mine, it was working great, so I downgraded to the same configuration as my other project, and it worked instantly in DEV, here it is :
"@react-native-firebase/analytics": "^7.4.1",
"@react-native-firebase/app": "^8.3.0",
"@react-native-firebase/messaging": "^7.6.1",
"@react-native-firebase/crashlytics": "8.3.0",
I'm just scared that I might introduce some breaking change (@mikehardy ?), otherwise it's all good for me. Might be a good point to start to find why it's not working with the lastest ones
Interesting from exactly what to exactly what versions? Then we can bisect
From this :
"@react-native-firebase/analytics": "^7.6.2",
"@react-native-firebase/app": "^8.4.2",
"@react-native-firebase/crashlytics": "^8.4.4", <--
"@react-native-firebase/messaging": "^7.8.6",
To that :
"@react-native-firebase/analytics": "^7.4.1",
"@react-native-firebase/app": "^8.3.0",
"@react-native-firebase/crashlytics": "8.3.0", <--
"@react-native-firebase/messaging": "^7.6.1",
How did it go with 8.4.2? There are only 2 changes in Crashlytics in the version range you just mentioned, and you removed both - curious how it goes with only removing the most recent change so you still have the change from 8.4.2
I was with the 8.4.2
when I noticed the issue, I tried everything using react-native-clean-project
and the right config with firebase.json
. But still, no luck.
Did the same thing with 8.4.4
and same results.
And then with 8.3.0
(It was arbitrary, same as another working project) it worked instantly.
There were no code changes between 8.3.0 and 8.4.2! That was just updating SDK versions for Android and the firebase-ios-sdk pod version 🤔
Could you try using either version (ideally the one you have working - our v8.3.0 here) - but varying the firebase ios SDK version?
You override it like so: https://rnfirebase.io/#ios
8.3.0 used 6.28.1 8.4.2 attempts to use either 6.30.0 or 6.31.0 (but current is 6.32.0)
I wonder if that's the problem? Something underlying may have changed
I'll try that tomorrow. First I must solve the issue that I can only reproduce in production 🙌
Sure sure :-), I appreciate the help a lot by the way, any success report or failure report, and especially a change between versions can help a lot pinning down how to make this thing work reliably. It's been an infernal voyage. Good luck with your production issue.
Hi @Daavidaviid,
When you installed 8.4.2 or 8.4.4 (as you said here, did you got same log as same as me like https://github.com/invertase/react-native-firebase/issues/4229#issuecomment-689186635?
I mean, did 'Completed report submission' appeared on your xcode console?
Hi @Daavidaviid,
When you installed 8.4.2 or 8.4.4 (as you said here, did you got same log as same as me like #4229 (comment)?
I mean, did 'Completed report submission' appeared on your xcode console?
Hey, no I didn't get this issue.
It's working fine when I crash the app on purpose with crash()
but with my issue, it doesn't work because the app crashes after the OS is killing it on purpose because of using too much memory.
I get the following message when I plug my device in xcode:
exceeding limit of 80% cpu over 60 seconds
Seems like it's because of this warning I've been ignoring : https://stackoverflow.com/questions/58791035/ios-13-2-message-nehelper-sent-invalid-result-code-1-for-wi-fi-information-re
@abdullahizzuddiin @Daavidaviid @mikehardy
I tried downgrade from 8.4.2
to 8.3.0
, the issue resolved instantly.
Can anyone use current (8.4.4) with pods overridden to 6.28.1 to divide the problem between react-native-firebase and firebase-ios-sdk? We've got piles of code here, and massive piles of code there and it would help focus where to find the problem if anyone that's easily reproducing problems could give the override a shot https://rnfirebase.io/#ios
@mikehardy I've given that a go and I've definitely got one crash report through but seemingly thats it, I've not dug through any debugging logs or anything, sorry can't be much more help than that, hopefully get back to it this evening
So yeah I think using 8.4.4 and the overriding pods to 6.28.1 works, I'm still not seeing the crashes but i can see them in the missing dsyms section, I think I need to tweak my fastfile line that uploads them as it must not be working quite right!
Oh bother. I really appreciate the attempt @rossjohnsonMP and pending some confirmation it sounds like we have a brand new failure mode, that is our code here may be slowly advancing (eliminating failure modes, having less surprising defaults...) and somewhere between 6.28.1 and 6.31.0 something changed underneath us. It appears there is always an opportunity to learn something new with iOS crashlytics these last couple months...
So sad for me.
I have tried to downgraded @react-native-firebase/crashlytics
to 8.3.0 version and also upgraded to latest (8.4.4 version) and overrode pods to 6.28.1, but still no crash report appeared on my firebase console.
From this :
"@react-native-firebase/analytics": "^7.6.2", "@react-native-firebase/app": "^8.4.2", "@react-native-firebase/crashlytics": "^8.4.4", <-- "@react-native-firebase/messaging": "^7.8.6",
To that :
"@react-native-firebase/analytics": "^7.4.1", "@react-native-firebase/app": "^8.3.0", "@react-native-firebase/crashlytics": "8.3.0", <-- "@react-native-firebase/messaging": "^7.6.1",
On the upper package.json android works fine. IOS works only in initial setup, i can't access the crashlytics dashboard, it remain stuck in the add sdk loading. Everything works fine with the versions listed below of the package.json
I'm not sure if this is just an issue I'm having, but in firebase i can see crashes being hidden because of missing dsyms.
After chatting to firebase they asked me to run:
dwarfdump -u < path-to-dsym >
After doing that i found that the UUID's in there did not match any of the missing crashes.
Then I downloaded the dysms from iTunesConnect and could see the UUID's of the missing crashes. So seems like something strange is going on
@rossjohnsonMP that's expected with bitcode-enabled apps - https://stackoverflow.com/questions/54577202/how-to-run-upload-symbols-to-upload-dsyms-as-a-part-of-xcode-build-process/55796619#55796619
Ahh thank you @mikehardy, missed that first step of getting fastlane to download the dsyms then upload the ones it downloads. Ok cool, one more thing to try, cheers!
From this :
"@react-native-firebase/analytics": "^7.6.2", "@react-native-firebase/app": "^8.4.2", "@react-native-firebase/crashlytics": "^8.4.4", <-- "@react-native-firebase/messaging": "^7.8.6",
To that :
"@react-native-firebase/analytics": "^7.4.1", "@react-native-firebase/app": "^8.3.0", "@react-native-firebase/crashlytics": "8.3.0", <-- "@react-native-firebase/messaging": "^7.6.1",
This worked for me, after uploading dSYMS to crashlytics I can see the crashes on iOS again. Cheers mate.
Okay - thanks for the report @Raymond-Cox - really sorry that a revert is needed at the moment. Our best guess at the moment is that if you used the most update version of the react-native-firebase version, combined with a pod override to 6.28.1 you will also enjoy success. It's a still a pending item to discover what happened in the pods, and more confirmation of a pod downgrade working for people would help upgrade that from hypothesis to evidence-backed theory
@mikehardy I am willing to explore the override to help build evidence. Real quick, is this how you do the pod override?
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
$FirebaseSDKVersion = '6.28.1' <----------
target 'vaultzap57' do
....
@mikehardy I am willing to explore the override to help build evidence. Real quick, is this how you do the pod override?
require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, '10.0' $FirebaseSDKVersion = '6.28.1' <---------- target 'vaultzap57' do ....
Yep that looks correct. It's on the rnfirebase.io front page also (for comparison)
@mikehardy Thanks for the confirmation, I'll create new builds with newest rnFirebase libraries and report back once I verify.
@mikehardy I waited until this morning, still didn't get any new crash reports in Crashlytics after doing the override.
:thinking: okay then, hypothesis that the underlying firebase-ios-sdk had a problem is busted. A further confirmation that hypothesis would be wrong is using the same package.json values to downgrade react-native-firebase but then override the pod there to 6.30 (or 6.32.2 as that is current now). That would isolate the problem between the version ranges in package.json that people have been posting here the last couple days. (and would also mean that we have some work to do here to fix it, obviously)
[EDITED by @mikehardy 20200913]: it appears the pods 6.28 may work fine with our
@react-native-firebase/crashlytics@^8.4.2
, but that pods 6.31 does not. This is an area of active investigation. But you may try overriding pods to 6.28 for now. https://rnfirebase.io/#iosOriginal issue follows:
Issue
I just upgraded
@react-native-firebase/crashlytics
from6.4.0
to8.4.2
. Crash report from iOS didn't displayed on Firebase Console Dashboard.What I've Done
xschme
,project.pbxproj
,podfile
,podfile.lock
firebase.json
crashlytics().setCrashlyticsCollectionEnabled(true);
in app codecrashlytics().crash()
After all things i've done, nothing resulted to displaying error on my Firebase Console.
This log displayed immediately after app builded and ran on my phone.
Sometimes,
1 unsent reports are available. Checking for upload permission.
displayed on console. But, nothing happened after I triggercrashlytics().sendUnsentReports();
I also followed this suggestion. I added
to
Info.plist
and it gave result.we may highlighted
Automatic data collection is enabled.
but no crash appeared on firebase console.On device log, It displayed this error
Project Files
Javascript
Click To Expand
#### `package.json`: ```json "dependencies": { "@react-native-community/async-storage": "^1.8.1", "@react-native-community/cameraroll": "^1.7.2", "@react-native-community/netinfo": "^5.6.2", "@react-native-community/push-notification-ios": "^1.0.7", "@react-native-community/viewpager": "^3.3.0", "@react-native-firebase/analytics": "^7.6.1", "@react-native-firebase/app": "^8.4.1", "@react-native-firebase/crashlytics": "^8.4.2", "@react-native-firebase/dynamic-links": "^7.5.2", "@react-native-firebase/in-app-messaging": "^7.4.2", "@react-native-firebase/messaging": "^7.8.4", "@react-native-firebase/perf": "^7.4.2", "@react-native-firebase/remote-config": "^9.0.3", "appcenter": "^3.0.0", "appcenter-analytics": "^3.0.0", "appcenter-crashes": "^3.0.0", "apsl-react-native-button": "^3.1.1", "assert": "^1.4.1", "babel-plugin-transform-remove-console": "^6.8.5", "crypto-js": "^3.1.9-1", "lodash": "^4.17.15", "lottie-ios": "^3.1.8", "lottie-react-native": "^3.4.0", "memoize-one": "^5.1.1", "moment": "^2.15.0", "moment-timezone": "^0.5.31", "prop-types": "^15.7.2", "react": "16.9.0", "react-native": "^0.61.5", "react-native-appsflyer": "^5.2.0", "react-native-check-box": "^2.1.7", "react-native-code-push": "^6.1.0", "react-native-collapsible": "^1.5.1", "react-native-config": "^0.11.7", "react-native-device-info": "^5.3.1", "react-native-emoji": "git+https://github.com/jorilallo/react-native-emoji.git", "react-native-fbsdk": "^1.1.2", "react-native-freshchat-sdk": "2.6.3", "react-native-gesture-handler": "^1.3.0", "react-native-hyperlink": "0.0.19", "react-native-image-picker": "git+https://github.com/abdullahizzuddiin/react-native-image-picker.git", "react-native-intercom": "^13.2.0", "react-native-keyboard-aware-scroll-view": "^0.9.1", "react-native-linear-gradient": "^2.5.6", "react-native-material-dropdown": "^0.11.1", "react-native-modalbox": "^2.0.0", "react-native-onesignal": "git+https://github.com/abdullahizzuddiin/react-native-onesignal.git", "react-native-photo-view": "git+https://github.com/alwx/react-native-photo-view.git", "react-native-reanimated": "^1.7.0", "react-native-router-flux": "^4.2.0", "react-native-screens": "^2.3.0", "react-native-scrollable-tab-view": "git+https://github.com/abdullahizzuddiin/react-native-scrollable-tab-view.git", "react-native-select-contact": "^1.3.2", "react-native-simple-toast": "^1.0.0", "react-native-spinkit": "^1.5.0", "react-redux": "^7.2.0", "redux": "^4.0.5", "redux-thunk": "^2.3.0", "rn-fetch-blob": "^0.12.0", "stream-browserify": "^2.0.1", "timers-browserify": "^2.0.10", "tty-browserify": "0.0.1", "url": "^0.11.0", "vm-browserify": "1.0.1", "warning": "^3.0.0" }, "devDependencies": { "@babel/core": "^7.6.2", "@babel/runtime": "^7.6.2", "@react-native-community/eslint-config": "^0.0.5", "@typescript-eslint/eslint-plugin": "^3.8.0", "@typescript-eslint/parser": "^3.8.0", "babel-jest": "^24.9.0", "babel-plugin-module-resolver": "^4.0.0", "eslint": "^6.5.1", "eslint-import-resolver-babel-module": "^5.1.2", "eslint-plugin-import": "^2.22.0", "eslint-plugin-module-resolver": "^1.0.0", "eslint-plugin-react-native": "^3.8.1", "jest": "^24.9.0", "jetifier": "^1.6.3", "metro-react-native-babel-preset": "^0.56.0", "react-devtools": "3.6.2", "react-test-renderer": "16.9.0", "reactotron-react-native": "^2.1.0", "typescript": "^3.9.7" } ``` #### `firebase.json` for react-native-firebase v6: ```json { "react-native": { "crashlytics_debug_enabled": true, "crashlytics_disable_auto_disabler": true, } } ```
iOS
Click To Expand
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # Uncomment the next line to define a global platform for your project platform :ios, '10.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'AppName' do # Pods for your project pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" pod 'React', :path => "../node_modules/react-native/" pod 'React-Core', :path => "../node_modules/react-native/" pod 'React-CoreModules', :path => "../node_modules/react-native/React/CoreModules" pod 'React-Core/DevSupport', :path => "../node_modules/react-native/" pod 'React-RCTActionSheet', :path => "../node_modules/react-native/Libraries/ActionSheetIOS" pod 'React-RCTAnimation', :path => "../node_modules/react-native/Libraries/NativeAnimation" pod 'React-RCTBlob', :path => "../node_modules/react-native/Libraries/Blob" pod 'React-RCTImage', :path => "../node_modules/react-native/Libraries/Image" pod 'React-RCTLinking', :path => "../node_modules/react-native/Libraries/LinkingIOS" pod 'React-RCTNetwork', :path => "../node_modules/react-native/Libraries/Network" pod 'React-RCTSettings', :path => "../node_modules/react-native/Libraries/Settings" pod 'React-RCTText', :path => "../node_modules/react-native/Libraries/Text" pod 'React-RCTVibration', :path => "../node_modules/react-native/Libraries/Vibration" pod 'React-Core/RCTWebSocket', :path => "../node_modules/react-native/" pod 'React-cxxreact', :path => "../node_modules/react-native/ReactCommon/cxxreact" pod 'React-jsi', :path => "../node_modules/react-native/ReactCommon/jsi" pod 'React-jsiexecutor', :path => "../node_modules/react-native/ReactCommon/jsiexecutor" pod 'React-jsinspector', :path => "../node_modules/react-native/ReactCommon/jsinspector" pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" pod 'Yoga', :path => "../node_modules/react-native/ReactCommon/yoga" pod 'DoubleConversion', :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" pod 'glog', :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec" pod 'Folly', :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec" # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # Pods for AppName pod 'AppCenter/Crashes' pod 'AppCenter/Analytics' pod 'AppCenterReactNativeShared' pod 'FBSDKLoginKit' pod 'FBSDKShareKit' pod 'Intercom' pod 'ZendeskSupportSDK' pod 'OneSignal', '>= 2.14.2', '< 3.0' pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info' pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios' pod 'RCTSelectContact', :path => '../node_modules/react-native-select-contact' pod 'react-native-cameraroll', :path => '../node_modules/@react-native-community/cameraroll' target 'AppNameTests' do inherit! :search_paths # Pods for testing end use_native_modules! post_install do |installer| installer.pods_project.targets.each do |target| if target.name == 'react-native-config' phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) phase.shell_script = "cd ../../"\ " && RNC_ROOT=./node_modules/react-native-config/"\ " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\ " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\ " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby" target.build_phases << phase target.build_phases.move(phase,0) end if target.name == "React" target.remove_from_project end end end end target 'AppName-tvOS' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # Pods for AppName-tvOS target 'AppName-tvOSTests' do inherit! :search_paths # Pods for testing end end target 'OneSignalNotificationServiceExtension' do pod 'OneSignal', '>= 2.14.2', '< 3.0' end pre_install do |installer| # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289 Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} end ``` #### `AppDelegate.m`: ```objc /* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import
#import
#import "Intercom/intercom.h"
#import "FreshchatSDK.h"
#import "AppDelegate.h"
#import
#import
#import
#import
#import
#import
#import
#if __has_include()
#import
#else
#import "AppsFlyerTracker.h"
#endif
#import
#import
@import SupportSDK;
@import ZendeskCoreSDK;
@import Firebase;
@import AppsFlyerLib;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//enable debug on release mode, disable when release to user or in debug mode
//RCTSetLogThreshold(RCTLogLevelInfo - 1);
// Intercom
[Intercom setApiKey:@""];
// Dynamic Links
[FIROptions defaultOptions].deepLinkURLScheme = @"id.AppName.release";
// Firebase init
[FIRApp configure];
// Freshchat init
NSString *FRESHCHAT_APP_ID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"FreshchatAppId"];
NSString *FRESHCHAT_APP_KEY = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"FreshchatAppKey"];
FreshchatConfig *config = [[FreshchatConfig alloc]initWithAppID:FRESHCHAT_APP_ID andAppKey:FRESHCHAT_APP_KEY];
config.gallerySelectionEnabled = YES;
config.cameraCaptureEnabled = YES;
config.teamMemberInfoVisible = YES;
config.showNotificationBanner = YES;
config.responseExpectationVisible = YES;
config.domain = @"msdk.au.freshchat.com";
[[Freshchat sharedInstance] initWithConfig:config];
[ZDKZendesk initializeWithAppId: @""
clientId: @""
zendeskUrl: @""];
[ZDKSupport initializeWithZendesk: [ZDKZendesk instance]];
id userIdentity = [[ZDKObjCAnonymous alloc] initWithName:nil email:nil];
[[ZDKZendesk instance] setIdentity:userIdentity];
[AppCenterReactNativeCrashes registerWithAutomaticProcessing]; // Initialize AppCenter crashes
[AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true]; // Initialize AppCenter analytics
[AppCenterReactNative register]; // Initialize AppCenter
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"AppName"
initialProperties:nil];
// Sentry init
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary *)options {
[[AppsFlyerTracker sharedTracker] handleOpenUrl:url options:options];
BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
];
return handled;
}
//Universal Links (iOS 9 +)
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler {
[[AppsFlyerTracker sharedTracker] continueUserActivity:userActivity restorationHandler:restorationHandler];
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application{
/* Reset badge app count if so desired */
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
[RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
// notify AppsFlyerTracker
[[AppsFlyerTracker sharedTracker] registerUninstall:deviceToken];
// Intercom
[Intercom setDeviceToken:deviceToken];
// Freshchat
[[Freshchat sharedInstance] setPushRegistrationToken:deviceToken];
}
- (void) application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *)info{
}
// onesignal background notification
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
[self processPaymentInfo: userInfo];
if ([[Freshchat sharedInstance]isFreshchatNotification:userInfo]) {
[[Freshchat sharedInstance]handleRemoteNotification:userInfo andAppstate:application.applicationState];
}
}
/* For devices running on ios 10 and above */
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
if ([[Freshchat sharedInstance]isFreshchatNotification:notification.request.content.userInfo]) {
[[Freshchat sharedInstance]handleRemoteNotification:notification.request.content.userInfo andAppstate:[[UIApplication sharedApplication] applicationState]];
completionHandler( UNAuthorizationOptionSound );
} else {
completionHandler( UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge );
}
}
/* For devices running on ios 10 and above */
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler {
if ([[Freshchat sharedInstance]isFreshchatNotification:response.notification.request.content.userInfo]) {
[[Freshchat sharedInstance]handleRemoteNotification:response.notification.request.content.userInfo andAppstate:[[UIApplication sharedApplication] applicationState]];
}
completionHandler();
}
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
[RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for the localNotification event.
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
[RNCPushNotificationIOS didReceiveLocalNotification:notification];
}
- (void)processPaymentInfo:(NSDictionary *) additionalData
{
NSLog(@"ON NOTIFICATION PROCESSING");
NSLog(@"%@", additionalData);
NSLog(@"Finishing payment transaction");
@try {
int fee = [[additionalData valueForKey:@"biaya"] intValue];
int status = [[additionalData valueForKey:@"statusTransaksi"] intValue];
int transactionId = [[additionalData valueForKey:@"idTransaksi"] intValue];
int transactionType = [[additionalData valueForKey:@"jenis_transaksi"] intValue];
if (fee > 0 && status == 2) {
[self finishPayment:transactionId withFee:fee];
} else if (fee > 0 && status == 6 && transactionType == 6) {
[self refundPayment:transactionId withFee:fee];
}
} @catch (NSException* e) {
NSLog(@"Payment info exception => %@", e);
}
}
- (void)finishPayment:(int) transactionId withFee:(int) fee {
[FIRAnalytics logEventWithName:kFIREventEcommercePurchase parameters:@{
kFIRParameterTransactionID: [NSString stringWithFormat:@"%d", transactionId],
kFIRParameterValue: [NSString stringWithFormat:@"%d", fee],
kFIRParameterCurrency: @"IDR"
}];
}
- (void)refundPayment:(int) transactionId withFee:(int) fee {
[FIRAnalytics logEventWithName:kFIREventPurchaseRefund parameters:@{
kFIRParameterTransactionID: [NSString stringWithFormat:@"%d", transactionId],
kFIRParameterValue: [NSString stringWithFormat:@"%d", fee],
kFIRParameterCurrency: @"IDR"
}];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [CodePush bundleURL];
#endif
}
@end
```
Android
Click To Expand
#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```
Environment
Click To Expand
**`react-native info` output:** ``` System: OS: macOS 10.15.6 CPU: (4) x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz Memory: 18.34 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.5.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.5 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: /undefined - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: ^0.61.5 => 0.61.5 ``` - **Platform that you're experiencing the issue on**: - [x] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** ``` "@react-native-firebase/analytics": "^7.6.1", "@react-native-firebase/app": "^8.4.1", "@react-native-firebase/crashlytics": "^8.4.2", "@react-native-firebase/dynamic-links": "^7.5.2", "@react-native-firebase/in-app-messaging": "^7.4.2", "@react-native-firebase/messaging": "^7.8.4", "@react-native-firebase/perf": "^7.4.2", "@react-native-firebase/remote-config": "^9.0.3", ``` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `N`
React Native Firebase
andInvertase
on Twitter for updates on the library.