像Firebase这样的库如何在不添加一行代码的情况下捕获异常?

时间:2016-06-17 06:39:05

标签: android firebase firebase-crash-reporting

我今天正在安装Firebase,他们的文档基本上说,将firebase-crash依赖项添加到您的应用程序依赖项,然后它开箱即用,无需添加任何代码行。它会自动捕获所有未捕获的异常。

现在我知道如果我要自己设置bug,我必须使用- (void)viewDidLoad { [super viewDidLoad]; self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; self.locationManager.pausesLocationUpdatesAutomatically = NO; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.activityType = CLActivityTypeOtherNavigation; locationManager.distanceFilter = 0; [self.locationManager startUpdatingLocation]; } -(void)sendLocalNotificationWithMessage:(NSString*)message { UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.alertBody = message; [[UIApplication sharedApplication] scheduleLocalNotification:notification]; } -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { [self sendLocalNotificationWithMessage:@"hello"]; } ,但Firebase如何在我的应用程序中没有引用它的情况下执行它?它是如何获得当前线程的?它是如何运行的?

Firebase doc:https://firebase.google.com/docs/crash/android

0 个答案:

没有答案