sI have for my universal-App the today-extension. When tapping in the tableView of the my extension the app is launching.
Test with simulator iPhones with iOS8 -> ok works and opens app
Test with simulator iPads with iOS8 -> ok works and opens app
Test with iPhone 5S iOS8GM -> ok works and opens the app
Test with iPadAir iOS8 (installed 17/9) -> extension shown when
tapping tableView disappears, come back after a few seconds, when
tapping again same procedure till after about 8 times made this game
the message "loading not possible" is shown.
Does anyone have the same issue and know a solution? Or what can I check?
EDIT to localize the problem:
My code in the today-extension is:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSURL *url = [NSURL URLWithString:#"hdb://"];
NSString *ZwischenZiel = [[self.todayParser.todayArray objectAtIndex:indexPath.row] View];
NSInteger Ziel = [ZwischenZiel integerValue];
NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:#"group.com.hotel-de-bordeaux.HdB"];
[sharedDefaults setInteger:Ziel forKey:#"ViewValue"];
[sharedDefaults synchronize];
[[self extensionContext] openURL:url completionHandler:nil];
[tableView deselectRowAtIndexPath:indexPath animated:NO];
}
The value in the sharedDefaults is stored correct. When starting the app after the today-extension by tapping the icon the app launches with the view corresponding to the stored ViewValue in the sharedDefaults.
So the iPad has a problem with the code:
[[self extensionContext] openURL:url completionHandler:nil];
because the selected row is deselected when appearing after a few seconds.
*********UPDATE**********
After hours of searching and trying I tested to run the today-extension on the iPad Air (real device) to get some logs what happens about the storing userDefaults.
Test1:
delete app from iPad Air. Installing the app with the main app scheme
this was only to be sure the issue is still there. Yes, no way to get from the today-extension to the app. In 1 of more than 30 attempts it worked.
Test2:
delete the app again. Installing the app with the today-extension scheme:
Now the app is installed but not launched. Instead the notifications opens and the today-extension comes up. In the logs all values are right. Touching one of the cells opens the app as it should!!! And the app is working too. Closing the app and opening the notifications - all logs are correct, all working right.
So there must be a bug in my iOS8 update/general for the iPad or a bug in the xcode6. Or I crated a very special app ;-) On the iPad it depends how I install the app!
Results:
installing by main scheme iPhone -> all correct
installing by main scheme iPad -> app runs ok, extension problems to open app
installing by extension scheme iPhone -> all correct
installing by extension scheme iPad -> all correct
Too fast - it seems that there is a difference which scheme is used as long as the iPad is connected via USB to the imac. When solving the connection the old issue returns. :-(
How can I figure out if my iOS-installation on the iPad has a "error" or the xcode6-installation has a problem?
Ok, last night I played with this issue. By chance I tapped the first row of the tableview in the today-extension and the app opens correct. Thought it was good luck and tried again. The result of 5 minutes trying was: using the first row of tableview the app opens correct, second to last row used to "touchupinside" causes the issue. This morning I cleared all constraints in the extension-storyboard. (There were no warnings or other stuff - and as said it worked correct on iPhone and iPad-Simulators). Made all constraints new as before and now all works fine on the iPad too.
Related
I tried uploading my first app yesterday (swiftui) and now got back an error saying that my app creates a blank screen on ipad. I didnt intend the app to be used on ipad but now when i checked it does indeed display a white blank screen. However it works on any iphone model.
How do i fix this? Or is there a way to only launch the app for iphones?
Go to Target -> General -> Deployment Info -> Uncheck iPad
This will still run the app on iPad, but just like it runs in iPhone(same frame.)
We have an app on the App Store that is experiencing problems.
The app works fine through XCode, the app works fine when launched from the iPhone/iPad/iPod "dock" (the screens with all the apps, not sure what the official name is). However when trying to open the app straight from the App Store by pressing the "Open"-button, the app behaves strangely. The behaviour is also different on different devices.
We have 3 devices we can test on, an iPhone 7 Plus running iOS 10.3.1 (also tested on 10.2.1), an iPad Air 2 running 10.2.1 and an iPod Touch Gen 5 running 9.3.
iPhone behaviour: App opens then gets stuck at a black screen with an empty title bar.
iPad behaviour: App opens, skips the entire first tutorial view and continues to work as it should.
iPod behaviour: App works as it should.
The iPhone 7 Plus running 10.2.1 behaved exactly the same as when it's running 10.3.1.
I have tried finding more information about this problem but have so far been unable to. Have there been any other cases like this, and if so, is there a fix?
UPDATE: I HAD THE CHANCE TO TEST THIS ON AN IPAD RUNNING 9.X, THERE WERE NO PROBLEMS, SO THIS SEEMS TO BE A 10.X ISSUE
My problem ended up being the following. I pass the launchOptions from this function
-(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
to another function and then check whether it is nil or not. However when it launched from the App Store it wasn't nil, specifically the following key:
[[launchOptions objectForKey:UIApplicationLaunchOptionsSourceApplicationKey] isEqual: #"com.apple.AppStore"]
It was trying to run code for when the launchOptions aren't nil, when in fact they were, except for that key.
I've updated launch screen on an enterprise app, but it won't update when installed on an iPad with the existing app. I've tried completely deleting the app before installing a new version, but it still launches with the old launch screen image.
I've tried installing the new app on another iPad where this app was never installed and the new launch screen appears as expected. Both iPads run the same iOS v9. The app was built with xCode 7.2
In summary I've tried the following scenarios:
updating existing app (version 1) on iPad A - with a new app (version 2)
iPad A, loads the new app v2 with launch screen from version 1
installed new app (version 2) on iPad B, which never had this app.
iPad B, loads the new app v2 with correct launch screen
then I installed old app version 1 on iPad B
iPad B, now loads the old app v1 with launch screen from version 2
It seems the iPad somehow caches the launch screen from the very fist install regardless which version it is. Deleting the app and reinstalling does not seem to help and it does not look code related as the correct launch screen images was loaded on iPad B
I just had this problem and i found that deleting the app off the device or simulator, then restarting the device or simulator seems to fix the issue.
I found just restarting the device didn't work.
I had tried many kinds of solutions and restart your iPhone is the only way.
In xcode, under Assets.xcassets, I clicked on LaunchImage and then unchecked Universal, checked iPhone, unchecked iPhone, and checked Universal again. Then ran build and it cleared the old image.
Simulators and iPhone caches the launch images.
this can help you
1>Clear the derived data under your developer/xcode folder
2>reset the device by pressing home button and lock button at same time
3>Push your code to device and it will work, if this doesnt work then creat ipa file and install using itunes after resetting the device and it will show the new launch images
The answer by Steve still holds as of iOS 13.2.3, but I wanted to add a few more items just to back up this point that otherwise exceed the restrictions of a comment.
For starters, I did delete the app, restart the device, etc but because this issue occurs when a user updates through the app store, those fixes are simply not viable.
Then, I decided to take more drastic actions within the app to try and remedy this. These actions were taken with TestFlight builds.
In my particular case, the problem stems from a version string that misrepresents the installed version.
Step 1 then was to simply remove the UILabel in question. Re-running the app would still cause the label to appear in the app.
Step 2 then was to create an entirely new LaunchScreen storyboard and set it as seen here:
Launching the app still presents the old launch screen.
This leads me to believe that something in the project structure is the source of the caching, and no reasonable changes to the LaunchScreen by the developer are going to get around this.
Update
The app has been released to the Appstore, and using the official store release, the app presents the correct launch screen.
Solution
Again, thanks to the thread I have referenced above I found a way to solve this issue - name your new image differently from the one there was before in case your new one has the same name as the old one and put it out of the *.xcassets folder to the project directory and reference it in your UIImageView. And that's it.
Just delete app from simulated iPhone home screen.
On iPhone 11 Max version 2-finger click and drag up from outer margin of the iPhone which will bring you to the home screen and exit your simulated app.
Then 2-finger click and hold your app, delete app and close simulator.
Open Xcode and click play button to run your simulation and the launch screen should be updated.
P.S. Deleting Xcode cache and derived data couldn't hurt.
See Rambo's post about the issue. At least on iOS 13 you can clear this cache yourself:
import UIKit
public extension UIApplication {
func clearLaunchScreenCache() {
do {
try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard")
} catch {
print("Failed to delete launch screen cache: \(error)")
}
}
}
I'm testing my iOS app on my iPhone 4S (running iOS 6 or lower, I believe), which is a simple web browser. When I double tap the home button, close the app (by pressing and holding it, and clicking the "X" which appears), and click the icon to run it again, the app is frozen on the page it was on before being closed. When I then close and click the icon again, it doesn't load; the app simply stays open as a black screen, and doesn't even crash. How can I solve this problem?
Edit: My iPhone is running iOS 6.0. And I cannot see anything in the logs as I completely stop running the app. I'm new to iOS dev, so please be kind!
Edit 2: Issue solved. See my answer below.
The only option I can suggest you here is to debug your app. Whenever the app opens up after being terminated, didFinishLaunchingWithOptions in your AppDelegate class is called.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Try putting a breakpoint in there and check whats going on. Apart from this I cannot help you much.
I solved this issue by restarting my device (pressing and holding the power and home buttons). It seems the error was in some deep-ingrained code, and not in my own code I had written myself.
I am creating an iPhone app with some user authentication screens. I have created these screens in Storyboard. For example, landing screens, sign in screens, Sign up Screens etc.. and made connections between them using model segue. Every things work fine.
The Problem is that the app hangs in my iPhone 4 with iOS 7.1. I have also tested it on 4s, 5 and 5s all with iOS 7.1. In all these devices App works fine and fast without hanging.
Can anyone suggest me why it hangs when i go from one screen to other screen like (Sign In, Sign Up, etc..) in iPhone 4.
Since you are using Google Maps SDK, you could check this issue.
I encountered the same problem, and in the end I ended up switching to Apple maps, since Gmaps has a tendency to leak memory, for what I witnessed at least...
iPhone 4 is a single-core device while all the other iOS7 ready devices are dual-core. Maybe it can't keep up with initializing your view and thats why it lags.
You should try Time Profiler from Instruments to catch what is too much for a single-core device.
I have this same error when I was trying to launch an UIAlertView in the start of application.
Try not to launch do anything in main thread before you have set your window key and visible in
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
...
[self.window makeKeyAndVisible];
}
I hope this helps