I have to design an iOS app which will download a pdf file and there will be an "open in" by UIActivityViewController
(UIActivity
subclassing) .Using OpenUrl
I sent data to the other application and I can get pdf data in second application.
But I want the same functionality with Safari also. I want to see the second app in safari "open in" and once user get some pdf in Safari, user can click open in to get pdf data in second application.
- (void)performActivity {
NSString *urlstring=@"ran/jan/jena/getit";
NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"ranjantest:///%@",urlstring]];
BOOL checkurl=[[UIApplication sharedApplication]canOpenURL:URL];
if(checkurl){
[[UIApplication sharedApplication] openURL:URL];
}else{
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"" message:@"No suitable App installed" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
}
Any suggestion how to do it ?