ios - Take a picture after BTLE background notification fired -
i'm developing app runs in background mode, app receives bt notifications btle accessory.
when specific notification, want take picture whether app running in background or foreground.
first question: app rejected apple because of taking photos in background mode?
second question: best option this?
at first thought using uiimagepickercontroller, i'm using avfoundation avcam example because not need show preview.
but, third , last question: show preview? have tried use following code. works ok if app running in foreground mode, not background mode:
uistoryboard *mainstoryboard = [uistoryboard storyboardwithname:@"iphone5storyboard" bundle:nil]; avcamviewcontroller *camviewcontroller = [mainstoryboard instantiateviewcontrollerwithidentifier:@"viewcontrollercamera"]; uiviewcontroller *rootvc = [[(appdelegate *) [[uiapplication sharedapplication] delegate] window] rootviewcontroller]; [rootvc presentviewcontroller: camviewcontroller animated:yes completion:nil]; many doubts.
first off, cannot take picture when app not in foreground. that's core ios limitation. (you jailbroken iphone though).
as second part of question, avfoundation great way work camera functionality. it's flexible on view presentation , type of filters you'd apply video stream. avcam example great example.
and third, goes first point. no matter use, can't take pictures in background unless it's in foreground , user has given permission.
i suggest submitting local notification , asking user bring app foregound when want take picture. not news wanted hear, that's how apple intended used.
Comments
Post a Comment