How to use Crashlytics with iOS / OS X today view extensions?
Crashlytics support got in touch with me and provided these steps. I tested them and it now works for me iOS 8 app.
Add the Crashlytics Run Script Build Phase to your extension's target as well (copy / paste the same you added to your main app)
Add the
Crashlytics.framework
to your extension's linked libraries
(e.g. simply check the extension target in its file inspector)Add the
Crashlytics.startWithAPIKey("yourApiKey")
to your extension's view controller'sinitWithCoder
method. (In Apple's today extension template it is calledTodayViewController
by default)> if you have no
initWithCoder
method yet, it should look like this afterwards:required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
Crashlytics.startWithAPIKey("yourApiKey")
}
Is it possible to use Crashlytics with an extension?
I've successfully done it for extensions, but it is tricky (and I don't know if it's officially supported). You're right the main app doesn't know when an extension crashes, so you need to make sure you start Crashlytics from the extension when the process starts. For NSE, I start it in the didReceive(:)
function since that's the starting point of the process.
Each extension also has it's own separate Google-Info.plist
file so it's reported separately from the main app.
How to use Crashlytics with iMessage Extensions?
Mike from Fabric here.
We have experimental support for only Crashlytics on iMessage Extensions. To get things working:
- Add your Fabric Run Script Build Phase to your extension's
target. Copy and paste the one in your main app. - Add the Fabric and Crashlytics.framework to your extension's
linked libraries Add the
Crashlytics.startWithAPIKey("YourActualApiKey")
to your
extension's view controller'sinitWithCodermethod
. If you don't
have aninitWithCoder
method currently, it should look like this
in the end:required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
Crashlytics.startWithAPIKey("yourApiKey")
}
Reference: https://stackoverflow.com/a/27153383/3975963
Related Topics
How to Generate an iOS IPA File with Ionic Framework
Open Specific View When Opening App from Notification
Disabled Uibutton Not Faded or Grey
How to Apply a Tintcolor to a Uiimage
Uirefreshcontrol - Pull to Refresh in iOS 7
Tableview Reloaddata VS. Beginupdates & Endupdates
Can't Prevent 'Touchmove' from Scrolling Window on iOS
Nstimer - How to Delay in Swift
Get iOS Itunes App Store Id of an App Itself
How to Check If a Uialertcontroller Is Already Presenting
How to Delete App Build in New Itunes Connect Site
How to Add Textfield in Uialertcontroller
Sendasynchronousrequest Was Deprecated in iOS 9, How to Alter Code to Fix
How to Subclass Uitableviewcontroller in Swift
How to Populate Uitableview from the Bottom Upwards
Avplayer Resuming After Incoming Call
Error Appstore Connect:Missing Purpose String in Info.Plist File