Skip to content

Conversation

@radazzouz
Copy link
Contributor

@radazzouz radazzouz commented Jul 2, 2018

The iOS implementation of #82

How to test

  • Create a new React Native sample app: https://github.com/PSPDFKit/react-native#ios
  • For step 4, use this branch: yarn add github:PSPDFKit/react-native#rad/js-events-ios
  • For step 15, use the following code in your App.js
import React, { Component } from 'react';
import { NativeModules } from 'react-native';
import PSPDFKitView from 'react-native-pspdfkit'

var PSPDFKit = NativeModules.PSPDFKit;
PSPDFKit.setLicenseKey('YOUR_LICENSE_KEY_GOES_HERE');

export default class App extends Component<{}> {
  render() {
    return (
      <PSPDFKitView
        document={'document.pdf'}
        configuration={{
          pageTransition: 'scrollContinuous',
          scrollDirection: 'vertical',
          documentLabelEnabled: true,
        }}
        style={{ flex: 1, color: '#267AD4' }}
        onDocumentSaved={this.onDocumentSaved}
      />
    )
  }
  onDocumentSaved() {
      alert('Document Saved');
  }
}
  • Launch the app
  • Add a new annotation
  • Invoke the share sheet to trigger a document save.
  • Observe the alert.

recording

What to test:

  • Make sure that there are now issues on Android and Windows

@radazzouz radazzouz added the iOS label Jul 2, 2018
@radazzouz radazzouz self-assigned this Jul 2, 2018
@radazzouz radazzouz changed the title [WIP] Add onDocumentSaved event for the UI Component Add onDocumentSaved event for the UI Component Jul 4, 2018
Copy link
Contributor

@steviki steviki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@import PSPDFKit;
@import PSPDFKitUI;

@interface RCTPSPDFKitViewManager() <PSPDFDocumentDelegate>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RCTPSPDFKitViewManager doesn't need to conform to PSPDFDocumentDelegate, since RCTPSPDFKitView handles this, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct! Nice catch! Addressed.

Copy link
Contributor

@nickwinder nickwinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this will not touch windows.

Copy link
Contributor

@simoarpe simoarpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for Android too 👍

@radazzouz radazzouz force-pushed the rad/js-events-ios branch from ba0fc8e to 2a6e5b6 Compare July 9, 2018 15:21
@radazzouz radazzouz merged commit 89104ea into master Jul 9, 2018
@radazzouz radazzouz deleted the rad/js-events-ios branch July 9, 2018 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants