结构-答案未在iOS上注册

时间:2018-07-09 13:45:21

标签: ios google-fabric fabric-answers

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

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 个答案:

答案 0 :(得分:5)

对于事件。.

  1. 从设备中删除已安装的应用,退出xcode并删除Derived data并更新您的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以获得更多帮助