开发者

trigger my app and open email attachment

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜