2017-06-02 9 views
0

「sample.ppdf」のようなRMS Protected PDFファイルがあります。 URLからロードされています。SKSafariViewController iOSで保護されたpdfを開くことはありません

今すぐ次を実装します。 UIApplication.SharedApplication.OpenUrl(新しいNSUrl(_documentUrl));

iPhoneのSafariアプリケーションが開き、私は次のコードで同じことを実行しようとすると、特定のアプリケーションの「AIP視聴者が

今で開くオプションのために私に尋ねる:

SFSafariViewController *svc = [[SFSafariViewController alloc] initWithURL:url]; 
svc.delegate = self; 
[self presentViewController:svc animated:YES completion:nil]; 

SKSafariViewControllerはなく、開きます空白です。

答えて

0
/*! @abstract Returns a view controller that loads a URL. 
    @param URL the initial URL to navigate to. Only supports initial URLs with http:// or https:// schemes. 
*/ 
- (instancetype)initWithURL:(NSURL *)URL; 

あなたはURLを確認してくださいは、http:// *またはhttps:// *

0

SFSafariViewControllerバージョンiOS 9.0+と互換性があります。 iOS versioniOS 9.0より小さい場合はバージョンチェックを入れ、サファリブラウザで直接開きます。

NSURL *urlAsString = [NSURL URLWithString:[NSString stringWithFormat:@"Your_URL"]]; if ([SFSafariViewController class] != nil) { SFSafariViewController *sfvc = [[SFSafariViewController alloc] initWithURL:urlAsString]; [self presentViewController:sfvc animated:YES completion:nil]; } else { [[UIApplication sharedApplication] openURL:urlAsString]; } 

、これを試してみてください
関連する問題