ios - MKMapSnapshotter completionHandler never called in parent app when called from WatchKit -
i have weird issue: call parent app openparentapplication:reply:
normal.
it nicely doing job getting data internet using async nsurlrequests
when want map image using mkmapsnapshotter
(still in parent app) completion block never called.
mkmapsnapshotter *snapshotter = [[mkmapsnapshotter alloc] initwithoptions:options]; [snapshotter startwithcompletionhandler:^(mkmapsnapshot *snapshot, nserror *error) { nslog(@"completion handler called"); //this never called };
i tried call with: snapshotter startwithqueue:
on dispatch_get_global_queue(dispatch_queue_priority_background, 0)
or dispatch_get_main_queue()
etc. nothing seems work.
if call same code directly wkinterfacecontroller
or parent app works fine.
i don't think can call/use mkmapsnapshooter
way wanting to. when use openparentapplication
make request, opening parent app in background mode , mkmapsnapshooter
requires foreground mode deliver final image.
as per apple docs:
the snapshotter delivers final image app when running in foreground. snapshotter must render final image while app in foreground. if start generating snapshot while app in background, or if app moves background while snapshot in progress, behavior delays delivery of snapshot until app returns foreground.
Comments
Post a Comment