0

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

loading and starting the app

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:

loading ans starting the extension

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?

Christian
  • 506
  • 4
  • 14
  • I have used open URL in extension without problem in iPhone and iPad. Could it be something else? – honcheng Sep 25 '14 at 03:49
  • It could - I wonder because it runs without problems in both simulators (iPad and iPhone) and with real device iPhone works and iPad not. – Christian Sep 25 '14 at 06:31
  • I have a problem with running Today widget on a real iPad Air 2 (iOS 8.1.3) too. The content is not showing up. It's a different problem, but similarly the app works on real iPhones, and on all simulators, but just not on a real iPad Air. Just to say, it's weird. – samwize Feb 18 '15 at 03:01

1 Answers1

0

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.

Christian
  • 506
  • 4
  • 14