How would it be possible to have an iOS app display the user's wallpaper? Apple uses this in places like the tab view in Safari and the keypad in Phone. Setting the transparency of UIWindow proved to no avail...
This is no longer available. Too bad, because it allowed a sweet native looking effect
there are a few things you need to do to show the user wallpaper
1 - set UIApplicationIsOpaque to false in the project plist
2 - In the app delegate load function
self.window.backgroundColor = [UIColor clearColor];
self.window.opaque = NO;
3 - set the UIViewController.view background color to [UIColor clearColor]
This works for us currently. If you try to do a screen capture or actually use the wallpaper it just returns solid black (so privacy concerns don't apply since you can't do anything with the wallpaper).
This functionality is not available to third-party developers due to privacy concerns.
If you could do this in a third-party app, you could capture the background image without asking the user.
Related
I've seen some apps for example (Vesper, or iPad's reminders app) make use of a user's home screen background image. How is that possible?
It must be some sort of clever trick to make a transparent View or Window or (Gulp!) Private API?
Anyone hazard a guess?
I haven't tried it myself, but I hear that the private method [[UIApplication sharedApplication] _setApplicationIsOpaque: NO] may do what you're after.
iOS 13 beta 1 supports setting UIApplicationIsOpaque to NO in Info.plist. But, it’s not documented so it will maybe be removed or not allowed on the App Store.
I am developing an app in which user gets alerts for Quran time. Now when user is in prayer i want to lock my device for that time same like enabling kids mode. How that can be achieved in iPhone.
Apple hasn't released any kind of Public API to do so. And I'll never recommend to use the Private API's (if available in this case), cause it's could lead to reject your app.
In my knowledge I only knew how to prevent the phone from locking while your app is running.
Objective-C
[UIApplication sharedApplication].idleTimerDisabled = YES
Swift
UIApplication.sharedApplication().idleTimerDisabled = true
You can add treatment for this inside the app, but unless the device is jailbroken, you cannot prevent the user from pressing the device's home button and leaving your app.
If you just want the user to stay on a specific screen of your app, you can disable user interaction (either by setting userInteractionEnabled = NO on the main ViewController's view, or by adding a transparent UIButton that will cover the entire screen, catch the presses and do nothing with them, as long as the payer is in session). You can also keep the screen from locking for that duration of time by using:
[UIApplication sharedApplication].idleTimerDisabled = YES;
And setting it back to NO when the prayer is done (only if you choose to).
However, the user will still be able to leave the app by using the device's physical home button that will take him back to the home screen.
I recently noticed that there are some apps in the iOS app store which claim to be able to change the color of both the status bar and the dock of the iOS Springboard. This seems impossible because such system-wide changes are almost never allowed by Apple, and after some googling I have found no answer. Here is an example of a dock color changing app, and here is an example of a status bar changing app.
Searching SO appears to bring up code for changing the status bar in the app, which is not very difficult, but not outside of the app. However, this functionality has clearly existed for a while, for example in the Voice Memos native iOS app, which turns the status bar red while recording.
Lastly, apps such as voice Memos and the native Music app appear to bring up special controls or animations when in use on the lock screen. It is possible to use the built-in iPod lock screen controls for other music apps, (see here), but I have seen no examples of custom lock screen app controls that made it through the app store.
Sorry to pack so many questions in one, but these are all examples of apparent across-system functionalities which I and likely many others would like to replicate, and thus merit attention.
As a postscript, is it possible that the color changes in dock and status bar are done but changing those parts of the wallpaper extremely so that when seen through the translucent UI they look like less bright but still noticeable colors? Thanks!
All of the examples app you have given just change your background. Since the statusbar and dock are translucent they change color when you set the background made with these app as you background.
The red bar from the voice memos is a system indication that some app is recording, this is not something you can change. The The status bar will become green when you there is an active phone call going and you open any app. The same with tethering.
You can not add any custom lock screen controls, there is no option for this in the SDK.
I've seen some apps for example (Vesper, or iPad's reminders app) make use of a user's home screen background image. How is that possible?
It must be some sort of clever trick to make a transparent View or Window or (Gulp!) Private API?
Anyone hazard a guess?
I haven't tried it myself, but I hear that the private method [[UIApplication sharedApplication] _setApplicationIsOpaque: NO] may do what you're after.
iOS 13 beta 1 supports setting UIApplicationIsOpaque to NO in Info.plist. But, it’s not documented so it will maybe be removed or not allowed on the App Store.
I’m fairly sure this is going to be straight forward in that it’s probably not possible.
Basically, I’d like to be able to lightly see the background wallpaper through my view in the same way that the new Newsstand app does.
I've tried changing the alpha value of the view, and the background color to clear, but neither of these seem to do it.
Apple has removed the ability to use this api in 7.0.3. What a shame.
You certainly can in iOS7, at least as of a few days ago. In our app once you set the following it makes your background transparent and shows the user wallpaper. If you try to programmatically take a screenshot, it will just show black instead.
Set UIApplicationIsOpaque to false in the project plist
In the app delegate load function:
self.window.backgroundColor = [UIColor clearColor];
self.window.opaque = NO;
Set the UIViewController.view's background color to [UIColor clearColor]
Good news. From iOS 13, the background transparency can finally be enabled for all third-party apps. It’s no longer a private API.
In your app’s Info.plist file, set the boolean value for
UIApplicationIsOpaque to NO.
And now the user’s wallpaper is visible inside your app.
It's not possible in iOS. While your app is running it does not mean that there is home screen behind your app.
However, If you do want to do it, there is a way that you make your app go in background, take screenshot and use that image as your background which will feel like home screen.
See this post. In this link, the accepted answer gives a way to take screenshot of home screen while your app is in background. But that's been achieved through a private API, which means your app probably will get rejected by App Store on time of submission.