开发者

trigger my app and open email attachment

开发者 https://www.devze.com 2023-03-08 02:43 出处:网络
I have used CFBundleDocumentTypes and ask system to trigger my app when I touch the email attachment file.

I have used CFBundleDocumentTypes and ask system to trigger my app when I touch the email attachment file.

It worked and my app worked as expected. But how can my app get the attachment file handle to process开发者_运维技巧?

Welcome any comment


I did the same task a few weeks ago. You have to do it like this:

NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
if ([url isFileURL]) {
    //Do wahtever you want to do with the attached file...
}

Use this code snippet in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; Method.

I hope this helps you.

Sandro Meier

0

精彩评论

暂无评论...
验证码 换一张
取 消