2

I'm using the application:openURL:sourceApplication:annotation: to open a file with an extension .ftl. This is declared in my app's info property list.

The .ftl file is attached to an email, and when touched calls an ALREADY LAUNCHED app. The code works fine in IOS 4, but in IOS 6 the above app delegate method isn't called.

The code is in my app delegate is simply:

 -(BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
 {

     NSLog(@"method is called");

     if (url != nil && [url isFileURL]) {

         [self performSelector:@selector(splashFade) withObject:nil];

         NSLog(@"inside if statement called");

         //Calls singleton to delete existing data, parse and ingest supplied new file data into Coredata:

         [[ContentController sharedInstance] deleteSectorList:(NSURL *)url];

     }
     return YES;
 }

Does anyone have any idea why this method is no longer called?

Thanks.

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
Lee Barringer
  • 103
  • 2
  • 9
  • Just to confirm, under iOS 6, does your app appear in the "Open In" menu for the attachment? And selecting it launches your app OK? It's just that this "openURL:" method isn't called as expected? – rmaddy Jun 30 '13 at 22:58
  • Actually, the icon appears in the "Open In" menu, but the App does not launch. If I NSLog the openURL method, it is not called. – Lee Barringer Jul 07 '13 at 13:18

1 Answers1

0

You have to tell the phone that your app accepts certain files. You do this by going to the info.pList and there you add a flag.

Follow this link which will cover this subject. https://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html%23//apple_ref/doc/uid/TP40010411-SW1

William Falcon
  • 9,813
  • 14
  • 67
  • 110
  • 1
    Hi, thanks for your post. I have already edited the info.plist file, and the app worked perfectly in IOS 4. It just doesn't on IOS 6. – Lee Barringer Jun 30 '13 at 12:33