YosiFZ
YosiFZ

Reputation: 7900

Open file with my app

I am using to open files that the user get in mail with my app :

    <key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>RTF</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.rtf</string>
        </array>
    </dict>
</array>

there is a problem that when the app come from the background it won't call :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

so where i get the notification about the file that opend with my app?

Upvotes: 2

Views: 484

Answers (1)

Casey
Casey

Reputation: 398

When your app comes out of the background to handle a file open, openURL will be called instead of didFinishLaunchingWithOptions here's the full signature:

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

Upvotes: 2

Related Questions