Some test text!

Search
Hamburger Icon

iOS / Guides

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 SDK does not require a trial key. A commercial license key is required for use in a production environment. Please fill out our contact form if you do not have a valid license key.
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:

https://github.com/PDFTron/pdftron-apple-package

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

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.)

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.

<key>NSCameraUsageDescription</key>
<string>This will allow you to use the image from your camera.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This will allow you to add images to your photo library.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This will allow you to create signatures and annotations from images in your photo library.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<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>
<key>NSBluetoothPeripheralUsageDescription</key>
<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:

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

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

View a document

Get the answers you need: Chat with us