IOS monitor photo album change when app is in background - ios

I'm building an app that is supposed to monitor picture taking even if the app is in the background.
For example:
A user opens the app, insert some settings and then puts the app in the background (locks the device or something). When the user opens the device again and take a photo with the camera, my app needs to catch that event.
I read some tutorials about the ALAssetsLibraryChangedNotification class and didn't exactly understand if this is what am I looking for because it doesn't say if this runs when app is in background.
I was wondering if someone here has some experience with this kind of thing and can give me some input about this kind of thing maybe an observer? Maybe a service? Any ideas?

Related

open the camera app while iphone in lock mode programmatically

I'm looking for solution that will enable my app to get an event from the server while the phone is in lock mode, when the event occurs the app will open the camera and take a picture.
while the phone remains locked and send the picture to the server in the back ground.
is it possible?
will apple store allow this kind of application?
Clarification:: the idea is not to take a picture without the user knowledge, the goal is to have him take a quick picture without having to open the phone & the application in order for that picture to be taken. If there is a solution that allows me to add a button like the camera build in next to the lock that's a great solution too.
Short answers
No,
No.
This is a huge violation of privacy, and has a great potential for abuse, therefore, there is no way to sneak pictures away from the user's device on demand.
You could send a push notification and ask a user to take a photo and upload it to your server on the other hand.

Is that possible to run apps in the iOS app if user close it?

For example: an alarm app, if user close this iOS alarm app, will this app still possible to alarm user at the time they set?
For another example: an LBS app, if user close this iOS LBS app, will this app still possible to detect user's current location? Not the location that last time user opened.
I know it's possible in Android, but can't find any way to do in iOS. Please let me know which library I can research to achieve that.
Thank you!
iOS apps can perform limited functions in the background. They are documented in the App Programming Guide:
https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20
You can set alarms by using local push notifications. (https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction.html)
You can track location by using the Location Updates background mode.

Using MultipeerConnectivity.framework to send and receive photos and text files

I want to give to the user of my app the ability to share a photograph without having an internet connection. It is quite hard to explain but I'll do my best. Basically in my app a user can press on a plus button to take a shot using their iPhone. This image is then uploaded on the Internet (Dropbox) in a common folder that can be accessed by all app users. When other users open the app, the image that has been uploaded is downloaded on their device. Since there might be more than one image, the app refreshes itself once in a while, and downloads the new photographs. I want to do the same thing using the bluetooth (or airdrop). When one device takes a picture, this is saved on the device, and sent to all app users nearby. These users can edit it, send it back to the original device where it can be accessed by everyone. basically the original device acts as a server, and all other devices stream the information from that device. The whole purpose of this is to have, say 15 different iOS devices all in the same room in sync which display the same exact thing. When someone edits, all the other people will see it, as if they where in sync with "the cloud" (which now is Dropbox).
I understood that this might be possible with MultipeerConnectivity.framework as it permits more than one device to be connected at the same time. I also found an example app called beam it: http://arctouch.com/beamit/
What I'm asking here is not really for some code, rather some indications on how I could approach the problem.

Prevent IOS to shutdown an app when it app switch to facebook for login and permission request

I am really stuck on this problem and I need your help!
I'm doing an ipad game with unity and the social network plugin from prime31.
The situation:
When you arrive to the end of level, the game gives you your score and ask if you want to submit it to facebook. If you do, In my script I've done a system that checks if you are logged in, if you aren't it ask you to login and then the system checks if the app has the publish permissions and if not it ask you the permission. If all theses if are true it posts a message to your wall straight. So hopefully the login/asking part needs to be done only once.
The problem:
When the ipad swap between the game and the facebook app to login, the ipad shutdown the game for saving memory. I've tried to reduce the scene, but it's hard to reduce it more than it is. So I thought maybe I should open that facebook login and authorisation inGame. For that I tried working with this:
setSessionLoginBehavior(FacebookSessionLoginBehavior.ForcingWebView);
And it does exactly what I want, it opens a small window in game, doesn't crash all good really. But the problem, in this solution, is that it only works for the login, and when I ask the publish permission it switches back to the facebook app to ask the permission and therefore crashes.
After more research, it seems that it's not doable to control the ask permission behavior.
So back to square one, how can I prevent IOS to shutdown my game while the user connects to facebook. I'm still looking to reduce the scene.
I heard of using the app url and sending data for the app (my game) launch after leaving the facebook app and therefore ask the ipad to relaunch the app at a specific scene. But that would be really the last solution because it's going to take a lot of rework to make that happened.
If you have another suggestions to work around this problem I'm up for it. All I need is login -> ask for publish permissions -> post and come back to the end of level screen of my game.
Thanks for the help
Put simply, once your app is backgrounded, if iOS wants to shut it down, you can't prevent that from happening.
The best thing you can do is save the state of your app before handing over to the facebook app for the authentication side of things, and then reload your state when the app starts up again. You'll want to handle applicationWillResignActive:, applicationDidEnterBackground:, applicationDidBecomeActive: and applicationWillBecomeActive:.
The App States and Multitasking section of the iOS App Programming Guide explains how you can do this.
I think you should check for FBDialog for iOS 5 and beneath. And FBNativeDialogs for iOS 6.
These will pop a window on the top of your app, so I guess it will still be running. And for iOS 6's FBNativeDialogs
Provides methods to display native (i.e., non-Web-based) dialogs to
the user. Currently the iOS 6 sharing dialog is supported.

What is the equivilent to a ContentObserver in iOS?

I use a ContentObserver in my android application to receive a notification whenever a photo is taken. Obviously iOS doesn't use the intent system, so is there an equivalent or alternative way to do this? I would prefer not to write a full camera application if possible.
This is not quite possible. Even the latest Google+ application on iOS, with its Instant Upload feature does not get notified when photos are taken, it simply checks the asset library while the application is running, and then as long as possible while running in the background before getting timed out by the OS.
The following is from the Google+ help on the matter:
Note: Photos and videos will upload while the Google+ application is
open and for a brief period of time afterwards.
HTH
You cannot run in the background and get notified when a picture is taken and saved to the Camera Roll by another app on iOS.
That said, you don't really need to write a whole camera app to be able to let the user take pictures from within your app, or to access Camera Roll from within your running app.
Take a look at UIImagePickerController. It is really easy to let the user select or take a photo on iOS.
There is no equivalent to ContentObserver in iOS.

Resources