Fabric - 未在 iOS 上注册的答案

Fabric - Answers not registering on iOS

我通过在应用程序委托中添加以下行来在我的项目中配置 Answers didFinishLaunchingWithOptions:

Fabric.sharedSDK().debug = true
Fabric.with([Crashlytics.self, Answers.self])

我已经接受了 Fabric 仪表板中的条款并且我看到了 "Waiting for events" 加载程序。我干净地安装了应用程序并 运行 它附加了调试器。控制台日志如下

2018-07-09 16:38:09.876038+0300 EDBiOS[21729:3627661] [Crashlytics] Version 3.10.3 (130)
2018-07-09 16:38:09.876290+0300 EDBiOS[21729:3627661] [Crashlytics] Running on iOS Simulator (iPhone), 11.4.0 (17F77)
2018-07-09 16:38:09.883163+0300 EDBiOS[21729:3627661] [Answers] Initialized
2018-07-09 16:38:09.886097+0300 EDBiOS[21729:3627661] [Fabric] Initialized with kit versions: {
    "com.twitter.answers.ios" = "1.3.7";
    "com.twitter.crashlytics.ios" = "3.10.3";
    "io.fabric.sdk.ios" = "1.7.8";
}
2018-07-09 16:38:10.611174+0300 EDBiOS[21729:3627991] [Fabric] settings downloaded successfully
2018-07-09 16:38:10.611995+0300 EDBiOS[21729:3627991] [Fabric] Settings are available for consumption
2018-07-09 16:38:10.613082+0300 EDBiOS[21729:3627957] [Answers] Answers enabled with settings: {
    "flush_interval_secs" = 10;
    "flush_on_background" = 1;
    "forward_to_google_analytics" = 0;
    "include_purchase_events_in_forwarded_events" = 0;
    "max_byte_size_per_file" = 8000;
    "max_file_count_per_send" = 1;
    "max_pending_send_file_count" = 100;
    "sampling_rate" = 1;
    "track_custom_events" = 1;
    "track_predefined_events" = 1;
    "track_view_controllers" = 0;
    url = "https://e.crashlytics.com/spi/v2/events";
}
2018-07-09 16:38:10.627885+0300 EDBiOS[21729:3627957] [Answers] Logging events to /Users/nstein/Library/Developer/CoreSimulator/Devices/4659652F-0FF0-4254-B265-A2E54BFAD542/data/Containers/Data/Application/CCD3B822-4E90-4B8A-AA46-713964FC9209/Library/Caches/com.crashlytics.data/myapp/analytics/v2/events
2018-07-09 16:38:10.630927+0300 EDBiOS[21729:3627957] [Answers] Transmitting packaged events for 'EB68FA02-082E-463D-A9E1-83FE1A969F10'.
2018-07-09 16:38:10.631427+0300 EDBiOS[21729:3627956] [Answers] Transmitting packaged events for '0E388FA3-95FB-4DD1-BC47-E9B1417E27AF'.
2018-07-09 16:38:10.631809+0300 EDBiOS[21729:3627957] [Answers] Transmitting packaged events for 'E1FE3C5D-693E-49E4-B8A7-6102EDC76C5C'.
2018-07-09 16:38:11.321912+0300 EDBiOS[21729:3627961] [Answers] Finished transmission of 'EB68FA02-082E-463D-A9E1-83FE1A969F10'.
2018-07-09 16:38:11.621711+0300 EDBiOS[21729:3627961] [Answers] Finished transmission of '0E388FA3-95FB-4DD1-BC47-E9B1417E27AF'.
2018-07-09 16:38:11.632826+0300 EDBiOS[21729:3627956] [Answers] Finished transmission of 'E1FE3C5D-693E-49E4-B8A7-6102EDC76C5C'.

问题是加载程序永远不会在仪表板上消失。答案似乎从未被注册。应用 运行正在 iOS 11.4 iPhone 模拟器、Xcode 9.4.1 上运行。在 macOS 上使用 Fabric 应用程序将框架添加到我的项目中。

对于事件..

  1. 从设备中删除已安装的应用程序,退出您的 xcode 并删除 并更新您的 pod

  2. 现在打开您的项目并清理您的项目 (⌘+Option+Shift+K.)

    对于答案, 在 AppDelegate

    中添加 Fabric.with([Answers.self, Crashlytics.self])

并确保您已在 infoPlist 中添加 kitName

<key>Fabric</key>
    <dict>
        <key>APIKey</key>
        <string>xxxxxxxxxxxxxxxxxx46654</string>
        <key>Kits</key>
        <array>
            <dict>
            <key>KitInfo</key>
            <dict/>
            <key>KitName</key>
            <string>Crashlytics</string>
            </dict>
        
        <dict>
            <key>KitInfo</key>
            <dict/>
            <key>KitName</key>
            <string>Answers</string>
        </dict>
        </array>
    </dict>
  1. 构建您的项目 (⌘B)

  2. 运行 项目

    现在,在浏览器中硬刷新仪表板

感谢@nstein 改进答案。 Discussion Chat 获取更多帮助