watchOS app uses different app icon on the home screen than in the App Switcher - apple-watch

I'm using the watchOS simulator in order to test my app. For some reason, the system uses an older app icon in the App Switcher than the one being displayed on the home screen, despite my .appiconset containing the same resized image multiple times. What causes this and how can I make the correct icon show up?

This seems to be a caching issue and you should erase all Simulator content and settings in order to see the correct icon again by navigating to Simulator.app/Device/Erase All Content and Settings...
However, personally, I wouldn't worry about this too much, since it's a watchOS bug, not something wrong in your project settings.

Related

Can I hide Flutter app contents when the app is in Background?

I'm developing an app that works with sensitive information.
One of the requirements is that when a user puts the app in background the content that the app is currently displaying has to be hidden, so if another person navigate through the apps in background he can't see the last screen where the user was.
Any ideas on how to do that?
I tried to show an overlay when the app moves to AppLifecycleState.paused, but it doesn't work for me, the app prints a message if I want but it can't update the UI.
Edit
Shameless plug: i did a library for doing just that as I also needed it:
https://pub.dev/packages/secure_application
Answear
Build is not called after paused, at least on Android.
For Android I used a flutter_windowmanager package (modified to still be able to build on IOS):
https://github.com/neckaros/flutter_windowmanager
When my app need securing I add the flag secure:
FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE)
And my app is now a black screen in the app switcher.
You should still hide content your way for when the user get back to the app.
Otherwise you can go native:
https://medium.com/#mehmetf_71205/securing-flutter-apps-ada13e806a69

IPhone app shows previous state when opening

I have very weird problem. My app works cool on simulator but when installed on iphone it shows strange behavior
Suppose i was at settings page then I closed the app using home button. And then I start the app again after quite a while and I will always first get the settings page for one second and then the main loading screen. This happens for every other page even its not the settings ViewController
What is wrong?
Best Regards
Umar
Standard behavior, UI restoration. Your iOS apps picks up execution right where you left.
This means: if the app is pushed to background, a screenshot is taken. Coming back to the app, this screenshot will be shown and meanwhile your UI gets prepared.
If you have code in your app in applicationDidBecomeActive: or applicationWillEnterForeground: (see here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html) and that will immediately reconfigure the UI, you get the behavior described.
You can turn OFF UI restoration and have your app really quit instead of pushing it to background by changing a key in the info.plist: UIApplicationExitsOnSuspend

How to get iOS to properly respect the "apple-touch-icon-precomposed" link attribute for a "web app"

I have created several web apps for iOS that employ the apple-touch-icon-precomposed link attribute method for custom home screen icons without the gloss. However, I have run into an issue recently, where, after adding the home screen bookmark and then running the app and exiting the app (via multitasking), gloss is applied to the icon! I don't understand why this happens. I can't reproduce it on an iPad 2, but this keeps happening on my iPhone 3GS running 4.3.3. Also, it seems that it might have something to do with putting it in a folder?
The app is located at http://pattern86.com/apps/color if you'd like to inspect the code.
Basically this is what happens:
Add the app to the home screen. (No gloss--everything's good at this point.)
Quit the app from multitasking (It already shows the gloss here!)
Now the icon has the gloss effect! What gives?
(reposting as an answer, as requested:)
Could be something to do with the icon itself. Does the image have an alpha channel? Do your other, working, apps’?

Setting Wallpaper (Background image) in iOS Simulator home screen or lockscreen

I was scratching my brains over something when this popped in my mind. Can we set the simulator's home-screen background image to an image of our choice? Case in point is Xcode 3.2.2 simulator 3.1.3.
Certain versions of the simulator appear to support this, not just for the home screen but for the lock screen too (which you get to with Command ⌘+L):
Drag an image from your Mac to the simulator.
Mobile Safari opens. Click and hold the image.
Choose Save Image.
Go to Photos.app, and into the photo album.
Choose your image, and set it as the home screen background like you do on a device.
You may need to restart the simulator.
Note that since this isn't exactly officially supported, it may or may not work for you depending on your version of Xcode or the simulator.
It is possible (again) with the iOS Simulator version 6 (for iOS6).
First, add some images to your photo library. You can do this by using Mobile Safari (either surf the web or drag a local image to the simulator). Then perform a long press and save to camera roll.
Second, open "Photos", select the image and set as Background.
Third, restart the simulator (this irritated me at first, as it doesn't seem to work immediately)
How to do this for the Simulator in 11.4.
Drag and drop a photo on the phone.
Go to photo app and view app.
On the bottom bar you should see 3 icons. Hit the icon with the Arrow coming out of the box like you would AirDrop it to someone.
On the Options panel you should see Use as Wallpaper right below the AirPlay option.
Cheers
Hmm. Probably, since you cannot set backgroundimage on your homescreen(exept from the locked view) on on actual iPhone pre iOS4, you cannot do so in the simulator either.
Dragged the image onto the simulator (iOS 9.3) as #boltclock suggests, but nothing happened. However, I then noticed that the images I dragged were showing up in the Photos app on the simulator. From there I just set the wallpapers the same way that you set them on a physical device. Did not need to restart the simulator.
I thought I wasn't able to do this, but then I dragged the bottom row of options to the left and low and behold, there is the "Set as wallpaper" option.
:-)
Since this is an old question, I want to confirm this works in Simulator 13.2 for the iPhone 13 Pro Max (I'm running it on on macOS 12.2 Monterey).
In the simulator take Safari to the image you want to set as the background
Right click (or 2-finger press-click on trackpad)
Selected "Add to Photo"s from Pop-up menu
Open Photos app, and click the 'sharing' icon (box with up arrow coming out of it)
Scroll the popup upwards until you see the "Use As Wallpaper" menu item (if you have a Magic Trackpad, you can scroll with a three-finger swipe-up up on the screen)
That's it. You can set the Home and Lock screen that way.
While developing an iOS iPhone app using the simulator, I copied a space scene with just stars for the background and and moved the app icons all to the home screen except left my app icon alone on a different page that way I minimized light and clutter.

iPhone Mobile App (safari): which javascript events like onblur, onfocus or onbeforeunload are available?

So I just made my web-application "iPhone Friendly". So you can add it to your home screen and it has an icon, no chroming, etc etc.
The problem is that I want to display a custom splash-screen every time it is opened from the iPhone home screen. Right now it just shows the last screen viewed while it basically runs a refresh.
I have tried attaching events to window.onfocus, window.onblur, window.onbeforeunload, and NONE of them seem to work right when the app is being run in "mobile-app" mode.
Am I being dumb? Er.... don't answer that. Does anyone know what is wrong?
Unfortunately, with the restrictions Apple imposes, this is impossible.
My recommendation is to create a App Store application with a full-screen WebView. Then, you can use a default.png file and a ImageView for your splash screen. Also, you get a ton more visibility on the App Store. (Also, if you go this route, check out PhoneGap - http://phonegap.com/).
Update!! In the iPhone 3.0 update, mobile safari now supports the ability to specify an image to be used on startup:
Remember this only works with iPhones that are running 3.0+
The loading screen you are talking about is the loading screen for an APPLICATION, not a webpage, i.e its the loading screen for Safari. This has nothing to do with "the restrictions Apple imposes", just with the fact that because your web app still runs in the browser, the browser needs to load first. Like was also said, if you want to get around this you need to build your own app, in which you can specify the splash screen.
Are you using this?
<meta name="apple-mobile-web-app-capable" content="yes" />
If yes, it should refresh every time when you exit the web app and enter again. It will NOT show the last screen viewed. Hence you can show your splash-screen every time when it is opened. In another words, you should show a full screen div / image every time when you load the page.