Open RMS-protected documents
Foxit PDF SDK for iOS supports opening Microsoft RMS (Rights Management Services) protected PDF documents (often with a .ppdf extension). RMS is implemented via FSPDFViewCtrl extension APIs.
Prerequisites
- Register a Microsoft Azure application and obtain Client ID and Redirect URI.
- The SDK package includes RMS dependencies (MSAL, etc.).
Configure RMS
Before opening a document, set Azure app information:
objc
[pdfViewCtrl setRMSAppClientId:@"YOUR_APP_CLIENT_ID"
redirectURI:@"YOUR_REDIRECT_URI"];Handle MSAL callbacks
UIApplicationDelegate
Forward URLs in AppDelegate:
objc
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
return [FSPDFViewCtrl handleMSALResponse:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]];
}UISceneDelegate (iOS 13+)
Forward URLs in SceneDelegate:
objc
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
UIOpenURLContext *context = URLContexts.anyObject;
[FSPDFViewCtrl handleMSALResponse:context.URL
sourceApplication:context.options.sourceApplication];
}Check whether a document is RMS-protected
objc
BOOL isRMS = [pdfViewCtrl isRMSProtected];Check PPDF format
objc
BOOL isPPDF = [pdfViewCtrl isPPDF];INFO
RMS requires network access to verify user permissions. The first time you open an RMS document, Microsoft sign-in is shown.