I am trying to add a map to my custom keyboard extension. After I tried to add MKMapView to the keyboard, I immediately crash when the map view appeared. Therefore, I am trying to add a Google map to the keyboard. But no luck, I get an error message:
Terminating app due to uncaught exception 'GMSBackgroundAppException', reason: 'Background execution would crash in this scenario'
I copied the exact code from the documentation on Google maps, and I ran this code in another empty project, and it worked. But that just won't work in a custom keyboard extension. This gives me the error above. If you still want to see the code below:
- (void)viewDidLoad { [super viewDidLoad]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; mapView_.myLocationEnabled = YES; self.view = mapView_;
source share