我今天正在安装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