Some test text!

menu
search
Free Trial Support

Contents

Collaborating with WebViewer Server
Collaborating with Firebase Realtime Database
Using PDFTron's demonstration Firebase database.
Using a different Firebase database.

Realtime collaboration samples

This page only applies to Xamarin.iOS.

The iOS SDK includes a realtime collaboration sample app with the .dmg download (found in Samples/Other/Collaboration). It includes support for two different back-end servers:

  1. A demonstration instance of PDFTron's WebViewer Server (distributed as a Docker container)
  2. Google's Firebase Realtime Database

This guide will step you through running the sample.

linkCollaborating with WebViewer Server

The WebViewer Server sample uses WebSockets to communicate annotation changes and messages between the client and the server. The WebSocket API is provided by SocketRocket, and is integrated via CocoaPods.

  1. Open the workspace Collaboration.xcworkspace, and run the sample. The device will show the PDF viewer.
  2. Check Xcode's sample for a URL you can open in your computer's browser.

Now, when you create annotations on the device or the computer's browser, the annotation will show up on the other.

To collaborate on a different PDF, open the file TRNWebViewerServerService.m, and near the top of the file, change the string defined by NSString* DEFAULT_DOCUMENT.

linkCollaborating with Firebase Realtime Database

linkUsing PDFTron's demonstration Firebase database.

Firebase's Realtime Database is a NoSQL database. Accessing firebase requires Google's Firebase SDK, which is integrated via Cocoapods:

  1. Open the workspace Collaboration.xcworkspace.
  2. Open the file ViewController.m, and in the method -(void)viewDidAppear:(BOOL)animated, comment out the line of code under "OPTION 1" (which uses WebViewer Server), and uncomment the line under "OPTION 2" (which uses Firebase).
  3. Run the sample. The device will show the PDF viewer.
  4. Check Xcode's sample for a URL you can open in your computer's browser.

Now, when you create annotations on the device or the computer's browser, the annotation will show up on the other.

linkUsing a different Firebase database.

The firebase sample can be configured to connect to your own Firebase instance. To do this, follow these instructions:

  1. If you have not already done so, create a Firebase account.
  2. Using the Firebase console, in the Authentication section, under Sign-in method, enable Anonymous sign-in as a provider.
  3. Using the Firebase console, in the Database section, create a new Realtime Database.
  4. Using the Firebase console, in Project Settings (found by clicking the gear icon), create a new iOS app. Download its config file ("GoogleService-Info.plist"), and replace the sample's file of the same name with the newly downloaded version.
  5. Run the project. If you run the project a second time on a different device or simulator, you can collaborate using the 2 (or more) instances of the app.

Get the answers you need: Support

Free Trial Support

Contents

Collaborating with WebViewer Server
Collaborating with Firebase Realtime Database
Using PDFTron's demonstration Firebase database.
Using a different Firebase database.
close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.