Ios 如何在swift中实现试飞坠毁报告

Ios 如何在swift中实现试飞坠毁报告,ios,swift,crash-reports,testflight,Ios,Swift,Crash Reports,Testflight,我正在用swift开发一个应用程序。我集成了用于远程日志记录的测试飞行SDK。现在我想使用test flgiht SDK提供的其他功能。其中之一就是事故报告。在试飞中提供了示例代码c功能。如何实现这些c调用 提供了测试飞行的示例代码 /* My Apps Custom uncaught exception catcher, we do special stuff here, and TestFlight takes care of the rest */ void Handle

我正在用swift开发一个应用程序。我集成了用于远程日志记录的测试飞行SDK。现在我想使用test flgiht SDK提供的其他功能。其中之一就是事故报告。在试飞中提供了示例代码c功能。如何实现这些c调用 提供了测试飞行的示例代码

  /*
   My Apps Custom uncaught exception catcher, we do special stuff here, and TestFlight takes care of the rest
  */
  void HandleExceptions(NSException *exception) {
    NSLog(@"This is where we save the application data during a exception");
    // Save application data on crash
  }
  /*
   My Apps Custom signal catcher, we do special stuff here, and TestFlight takes care of the rest
  */
  void SignalHandler(int sig) {
    NSLog(@"This is where we save the application data during a signal");
    // Save application data on crash
  }

  -(BOOL)application:(UIApplication *)application 
  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    // installs HandleExceptions as the Uncaught Exception Handler
    NSSetUncaughtExceptionHandler(&HandleExceptions);
    // create the signal action structure 
    struct sigaction newSignalAction;
    // initialize the signal action structure
    memset(&newSignalAction, 0, sizeof(newSignalAction));
    // set SignalHandler as the handler in the signal action structure
    newSignalAction.sa_handler = &SignalHandler;
    // set SignalHandler as the handlers for SIGABRT, SIGILL and SIGBUS
    sigaction(SIGABRT, &newSignalAction, NULL);
    sigaction(SIGILL, &newSignalAction, NULL);
    sigaction(SIGBUS, &newSignalAction, NULL);
    // Call takeOff after install your own unhandled exception and signal handlers
    [TestFlight takeOff:@"Insert your Application Token here"];
    // continue with your application initialization
  }
以上代码的链接:


如果有任何帮助,我们将不胜感激。

也在寻找类似的东西:我认为您可以在单独的objective c文件中实现这一点,并在swift文件中使用它@CamiloAguilarI确实这样做了,但忘了在这里发布我所做的事情。为了记录在案,我写信给testflight,因为我只是得到了飞机坠毁的次数,但没有得到任何信息。他们有问题。我还没回来。