I posted a post which was named "Initialize Fabric in iOS with cocoa pods", regarding initialization with crashlytics. It basically asked how to initialzie crashlytics with an API key, without having to go through info plist.
That was solved by doing this:
Crashlytics.start(withAPIKey: FABRIC_API_KEY)
But then im trying to do the same for Answers:
Answers.start(withAPIKey: FABRIC_API_KEY)
But Answers doesnt have any .start method? How can I initialize this then?
It is later used in this line:
Fabric.with([Crashlytics.self, Answers.self])
Mike from Fabric here. Answers is included within Crashlytics by default, you only need to init Answers separately if you're not using Crashlytics. Using:
Fabric.with([Crashlytics.self])
is all you need to do.
Related
My app is using Crashlytics which is moved from Fabrics to Firebase Crashlytics. My problem is that I recently upgraded firebase Crashlytics and after this upgrade there is no "Logs" displaying with crash report. I cross checked all settings and code but couldn't find any possible reason.
It was working properly before upgrade. Now all crashes are being reported properly as all the information such as "Stack Trace", "Keys" are as before but "Logs" section is empty.
My question may be an "iOS Duplicate" of this question. Anybody please tell me if there is any part of code I'm missing to get this "Logs" data.
Here is the code I setup in my AppDelegate for configuration :
FirebaseApp.configure()
FirebaseConfiguration.shared.setLoggerLevel(.min)
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
Just to confirm, are you capturing log messages with Crashlytics.crashlytics().log()? See https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=ios#add-logs
With Fabric, it was the following (answered here):
Crashlytics.sharedInstance().version
With Firebase:
the instance is Crashlytics.crashlytics(), but there is no version on it
nothing of interest in FIRCrashlytics.h
Since Crashlytics is an NSObject, Crashlytics.version exists, but it's equal to 0.
I also looked on the FirebaseCrashlytics module to no avail.
The Crashlytics version is actually printed in the console when running FabricApp.configure in the AppDelegate, so it's clearly defined somewhere, but I need to access it to display it in the app:
${time_stamp} ${app_name}[${process_id}] [Firebase/Crashlytics] Version 4.3.1
The API was added to Firebase/Crashlytics 7.1.0: https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Functions#/c:#F#FIRFirebaseVersion
Swift:
FirebaseCore.FirebaseVersion()
Objc
FIRFirebaseVersion()
Chintan from Firebase here. This has just been implemented in the latest version of Crashlytics iOS SDK (7.0.1). So from now on Crashlytics will use the same version as iCore, so here’s the API for it: https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Functions
I am trying to customise Firebase Crashlytics reports by adding a couple of custom keys. I followed instructions from https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=ios
The iOS app is based on React Native. I have added dollowing in one of the methods of RNSPlashScreen.m:
[[FIRCrashlytics crashlytics] setCustomValue:templateVersion forKey:#"template_version"];
But I get following error:
Use of undeclared identifier 'FIRCrashlytics'
I tried adding:
#import FirebaseCrashlytics;
But then another error popped up:
Module 'FirebaseCrashlytics' not found
Although I can confirm that I have followed all steps as mentioned in the documentation and I am able to get the crash reports in Firebase console. I have also added use_frameworks! in my podfile.
I am facing issues in adding customer keys for the more detailed reporting. Any help will be appreciated.
I managed to make it work. Let me start by saying, I'm a newbie in iOS development. I was adding the tracking code in SplashScreen which was the primary concern I believe. I moved it to RootView class and it solved the issue.
About the import error, Replacing #import FirebaseCrashlytics; with #import "FIRCrashlytics.h" did the trick.
Let me know if anyone has any suggestion or comment on the same.
I am using the following tutorial to implement Twitter log in for an iOS app: https://firebase.google.com/docs/auth/ios/twitter-login.
I follow all the steps & when I get to var provider = OAuthProvider(providerID: "twitter.com"), Xcode is not happy. I get Argument passed to call that takes no arguments.
I am importing Firebase and installing the Pods as shown.
Any idea on what could be going wrong? Thanks!
I had already face the same problem, and it was solved by updating Firebase/Auth by Pod
pod update
I want to integrate Crashlytics (3.9.3) into an internal library but I am faced with the following situation:
One of our internal libraries we are using is already using TwitterKit(2.2.0) with Fabric (1.6.7). This means that it is already doing it's initialization using this method:
[Fabric with:#[[Twitter class]]]
Now, this means that we can't initialize Crashlytics the same way because Twitter initialization would not be taken into consideration, since "Fabric with" method is going to be ignored on subsequent calls.
I know that the best method would be to call fabric in the main app like this:
[Fabric with:#[[Twitter class], [Crashlytics class]]];
but in our case it's desired to not impact the applications that are already using the the old lib, and keep compatibility.
Now, would it be safe to replace the current Fabric Twitter initialization and add the Crashlytics initialization with legacy method like this?
// replace original with this with info taken from Info.plist
[[Twitter sharedInstance] startWithConsumerKey:consumerKey
consumerSecret:consumerSecret];
// in another place
[Crashlytics startWithAPIKey:#"a1b2c3..."];
Is fabric doing any other stuff under the hood except the above or is it just parsing the info.plist for the keys and initializing the frameworks? Should we worry about any issues? Tested it and seems to be working ok.
Also, I am aware that Twitter is no longer part of the newest Fabric, but we are using some older versions here.
What I've also noticed is that if we keep the "Fabric with Twitter" part unchanged and initialize Crashlytics with "startWithAPIKey" method, Twitter will not be initialized ok.
Mike from Fabric here. Your approach may work, but could cause many issues as we haven't tested any of the most recent versions of Fabric with that version of Twitter so you would be at risk of seeing strange SDK behavior.