Get started integrating Apryse iOS SDK

Welcome to Apryse. This guide will help you integrate a free trial of the Apryse iOS SDK into your Xcode projects for iOS applications. You can either integrate Apryse frameworks automatically using Swift Package Manager, CocoaPods, or install them manually by downloading the SDK. Pick whichever your option you prefer, but integrating with Swift Package Manager is the recommended approach. Your free trial includes unlimited trial usage and support from solution engineers.

Swift Package Manager Integration for iOS

No trial license key required.

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.

Keep your license keys confidential.

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).

Integrating Apryse SDK for your iOS application

Apple has information on using Swift Package Manager, which you may review for topics not covered in this guide.

Apryse is available as a Swift Package from the following URL:

sh

1https://github.com/ApryseSDK/pdftron-apple-package

To include it, open your project's Swift Package Manager pane:

Apryse Docs Image

Enter the github link to the package. Add a high maximum version number to ensure you are always up-to-date. Apryse versioning does not strictly follow a semantic versioning system. (We very rarely make changes that break public APIs.)

Apryse Docs Image

Add Required Permissions

Apryse uses a select number AppStore permissions to allow certain functionality such as adding image stamps and detecting the Apple Pencil. Your app's plist must include the following keys (with whatever description is appropriate for your app), or it will be rejected from the AppStore.

XML

1<key>NSCameraUsageDescription</key>
2<string>This will allow you to use the image from your camera.</string>
3<key>NSPhotoLibraryAddUsageDescription</key>
4<string>This will allow you to add images to your photo library.</string>
5<key>NSPhotoLibraryUsageDescription</key>
6<string>This will allow you to create signatures and annotations from images in your photo library.</string>
7<key>NSBluetoothAlwaysUsageDescription</key>
8<string>This will allow us to detect if an Apple Pencil is paired, enabling palm rejection and the ability to scroll with one finger while annotating.</string>
9<key>NSBluetoothPeripheralUsageDescription</key>
10<string>This will allow us detect if an Apple Pencil is paired, enabling palm rejection and the ability to scroll with one finger while annotating.</string>

Initialize Apryse

You only need to explicitly initialize Apryse when you have purchased a license key.

Initialize Apryse before you use any Apryse related classes or methods. This only needs to be done once.

The best practice to do this is to use the optional application:willFinishLaunchingWithOptions: method in the AppDelegate class found in either the AppDelegate.swift or AppDelegate.m file in the left pane depending on your choice of language:

1// In AppDelegate.swift
2import UIKit
3import PDFNet
4@UIApplicationMain
5class AppDelegate: UIResponder, UIApplicationDelegate {
6 var window: UIWindow?
7 //... Any methods already here
8 func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
9 PTPDFNet.initialize("Insert Commercial License Key Here After Purchase")
10 return true
11 }
12}

While you are trialing Apryse, you can pass any string to the initialize method. A string that is not a license key will enable demo mode, where all pages are lightly watermarked.

You can now use Apryse SDK to view, annotate and edit documents.

Note: SPM distributes the dynamic .xcframework only. If you wish to use the .framework, you will need to use CocoaPods or Manual integration. If you wish to use the static framework, you will have to integrate it manually.

Next step

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales