Is it possible to make app to take a photo and save it when certain view controller is reached? I ask because I want to capture users reactions so that they can compare their reactions later on.
Related
Is it possible to detect when the user takes a screenshot in any app while my app is in the background ? And how would I do that ?
If not, can I background check regularly for screenshots (not pictures from the camera) in the photo library ? Like every minute or hour ?
One way to get your app to detect Screenshots is:
Register with the Photo Library's PHPhotoLibraryChangeObserver
When your app receives a notification that a photo has been added,
check its PHAssetMediaSubtype
If the Subtype is PHAssetMediaSubtypePhotoScreenshot, you know a new
Screenshot has been taken.
The PHPhotoLibraryChangeObserver protocol notifies you of changes that
occur in the Photos library, regardless of whether those changes are
made by your app, by a user in the Photos app, or by another app that
uses the Photos framework.
https://developer.apple.com/reference/photos/phphotolibrarychangeobserver
I am writing an iOS app that keeps and displays the state of a system. It basically shows a light whose color represents state:
green/yellow/red light <==> OK/warning/danger
I'd prefer to show accurate state even when the app is backgrounded, and its snapshot is viewed thru the iOS multitask viewer (the view that looks like a rolodex, which you get after double-clicking the home button). I REALLY don't want to show a snapshot which displays an inaccurate state.
So my question is: can you change the view (or perhaps the app snapshot) while the app is in the background, so that when it's viewed in the multitask view it shows an accurate state.
I've seen that this is not recommended by Apple: from App Programming Guide for iOS
Avoid updating your windows and views. Because your app’s windows and views are not visible when your app is in the background, you should avoid updating them. The exception is in cases where you need to update the contents of a window prior to having a snapshot of your app taken.
However, Apple's music app does just this...if you start playing a playlist, then put the music app into the background, the cover art gets updated as the music app works thru the playlist. So this functionality must be possible somehow.
The best answer I can come up with after a bunch of searching is to alter my app's view to the splash image prior to entering background operation. This would ensure that inaccurate state isn't displayed, but also prevents showing accurate state.
You can change the snapshot view immediately before the snapshot is taken (A banking app, for example might want to obscure personal information), but you cannot continue to update the snapshot from the background once your app is suspended. You may want to adopt this approach in order to avoid displaying an inaccurate state; show nothing rather than stale data.
You might also want to consider some other options, such as a "today" widget that contains the updated status or posting local notifications when there is a significant change in status (such as entering the "red" state).
I need my app to provide users to click multiple pictures. I want a layout with two separate buttons, one for clicking picture and another for saving the picture taken in the document's directory of filesystem. This screen will be presented and UIImagePickerController will be opened.
When user clicks first button, we will disable this button and show the picture obtained in an overlay. And show another button(this will be enabled now) to save this picture.
When user clicks another button, we will disable this button and save it in filesystem. After saving successfully, we will again enable the first button to take more pictures.
I have tried and implemented this app and it works perfectly at our end. But our some users report of app crashing when UIImagePickerOriginalImage key returned is nil.
This doesn't even happen to them frequently. Instead they face this crash after a long usage of app. However, we have tried of taking more 200 pictures and saving too. It didn't lead to any crash.
Please anyone suggest what might be the cause for this crash. Or any other better workaround to implement this functionality.
I own a simple soundboard app, which basically plays a song when a button is pushed.
I wanted to know, if it was possible to show an ad after a certain amount of user interactions.
e.g when 20 sounds have been played, a fullscreen ad would pop-up.
I've integrated RevMob in to my app, if that makes any differences :)
Thanks!
As far as I know, with any ad provider (including RevMob), you have pretty decent control on when an ad should appear.
For RevMob, I see you can call "[[RevMobAds session] showFullscreen];" when you want to show a full screen ad (or RevMobAds.session().showFullscreen(); if you're using Swift -- you didn't specify).
So just add a counter property in your view controller and increment the number of user interactions you want to keep track of and then show the full screen ad when you're ready.
I am making an app that allows the user to add captions to their photos. I'd like to be able to allow the user to save / share 3 of their creations, and after they share for the third time, shut down the app until they purchase more credits.
I'm trying to think of ways that the user can get around this to use my app for free all the time. The only way I can think that the user can save a photo manually is to do a screen shot, which I know how to detect so I'm not worried about. Is there anything else I'm not thinking of?
You can do it in an indirect way like the Snapchat app. Taking a screenshot interrupts any screen touches. See this for the solution.
You can trap the screen shot event and if they do create a screen shot you can delete it.
You can display some watermarks .
Remove watermark only after they buy it.
Here is a stackoverflow link to add watermarks