Question

I have a doubt, is it possible to enable the "Open in" only for a particular condition? Let me explain... I am creating an application that will allow only some users to open in my application some files.

For a particular user, I want that tapping an item in mail app will be shown the popover "Open in MyApplication".

For the other ones, i don't want to show the pop up.

Is it possible?

I know that i can manage the situation directly on the application when retrieving the URL of the request, but i'd like to have the behaviour described above.

Was it helpful?

Solution 2

No, this is not possible. Your app either declares that it can handle files of a certain type or it doesn't. The standard "Open In" menu is based on what your app declares in the Info.plist. There is no way to make this conditional.

OTHER TIPS

You could always just prevent the opened file from being displayed in your app through:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {    
     if (url != nil && [url isFileURL]) {
          if([self wantedUser])
               [self openURL:url];
          else
               return FALSE;
     }    

     return YES;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top