如何使用Crashlytics与iOS / OS X今天查看扩展? [英] How to use Crashlytics with iOS / OS X today view extensions?

查看:103
本文介绍了如何使用Crashlytics与iOS / OS X今天查看扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于今天扩展程序以独立的进程运行,我确信它们不会记录任何崩溃的开箱即用。我假设我们需要分别在小部件上初始化Crashlytics。例如。在 viewDidLoad 方法的 TodayViewController

Since today extensions run as separated a process I am sure they will not log any crashes out of the box. I assume we need to initialize Crashlytics on the widget separately. E.g. in the viewDidLoad method of the TodayViewController.


  • 是否有人在任何iOS / OS X扩展中使用Crashlytics?如果是这样,你是如何实现它的?

  • 我也想知道在Crashlytics中为扩展创建一个单独的应用程序是否有意义。

推荐答案

Crashlytics支持与我取得联系并提供了这些步骤。我测试了它们,它现在适用于我的iOS 8应用程序。

Crashlytics support got in touch with me and provided these steps. I tested them and it now works for me iOS 8 app.


  1. 将Crashlytics运行脚本构建阶段添加到您的分机目标为好吧(复制/粘贴你添加到主应用程序中的那个)

  1. Add the Crashlytics Run Script Build Phase to your extension's target as well (copy / paste the same you added to your main app)

添加 Crashlytics.framework 扩展程序的链接库
(例如,只需检查文件检查器中的扩展目标)

Add the Crashlytics.framework to your extension's linked libraries (e.g. simply check the extension target in its file inspector)

添加 Crashlytics.startWithAPIKey (yourApiKey)到您的分机的视图控制器的 initWithCoder 方法。 (在Apple今天的扩展模板中,默认情况下称为 TodayViewController

Add the Crashlytics.startWithAPIKey("yourApiKey") to your extension's view controller's initWithCodermethod. (In Apple's today extension template it is called TodayViewController by default)

>如果你没有 initWithCoder 方法,之后看起来应如下所示:

> 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")
}


这篇关于如何使用Crashlytics与iOS / OS X今天查看扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆