diff --git a/README.md b/README.md index 4fa2ae70..3bc6b49f 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ The [PSPDFKit SDK](https://pspdfkit.com/) is a framework that allows you to view #### Requirements -- Xcode 9.3 -- PSPDFKit 7 for iOS -- react-native >= 0.48.4 +- Xcode 9.4 +- PSPDFKit 7.6 for iOS or later +- react-native >= 0.55.4 #### Getting Started @@ -33,18 +33,19 @@ Let's create a simple app that integrates PSPDFKit and uses the `react-native-ps 2. Create the app with `react-native init YourApp`. 3. Step into your newly created app folder: `cd YourApp` 4. Install `react-native-pspdfkit` from GitHub: `yarn add github:PSPDFKit/react-native` -5. Link module `react-native-pspdfkit`: `react-native link react-native-pspdfkit` -6. Create the folder `ios/PSPDFKit` and copy `PSPDFKit.framework` and `PSPDFKitUI.framework` into it. -7. Open `ios/YourApp.xcodeproj` in Xcode: `open ios/YourApp.xcodeproj` -8. Make sure the deployment target is set to 9.0 or higher: +5. Install all the dependencies for the project: `yarn install`. (Because of a [bug](https://github.com/yarnpkg/yarn/issues/2165) you may need to clean `yarn`'s cache with `yarn cache clean` before.) +6. Link module `react-native-pspdfkit`: `react-native link react-native-pspdfkit`. +7. Create the folder `ios/PSPDFKit` and copy `PSPDFKit.framework` and `PSPDFKitUI.framework` into it. +8. Open `ios/YourApp.xcodeproj` in Xcode: `open ios/YourApp.xcodeproj` +9. Make sure the deployment target is set to 10.0 or higher: ![Deployment Target](screenshots/deployment-target.png) -9. Change "View controller-based status bar appearance" to `YES` in `Info.plist`: +10. Change "View controller-based status bar appearance" to `YES` in `Info.plist`: ![View Controller-Based Status Bar Appearance](screenshots/view-controller-based-status-bar-appearance.png) -10. Link with the `libRCTPSPDFKit.a` static library (if `libRCTPSPDFKit.a` is already there but greyed out, delete it and link it again): +11. Link with the `libRCTPSPDFKit.a` static library (if `libRCTPSPDFKit.a` is already there but greyed out, delete it and link it again): ![Linking Static Library](screenshots/linking-static-library.png) -11. Embed `PSPDFKit.framework` and `PSPDFKitUI.framework` by drag and dropping it into the "Embedded Binaries" section of the "YourApp" target (Select "Create groups"). This will also add it to the "Linked Framworks and Libraries" section: +12. Embed `PSPDFKit.framework` and `PSPDFKitUI.framework` by drag and dropping it into the "Embedded Binaries" section of the "YourApp" target (Select "Create groups"). This will also add it to the "Linked Framworks and Libraries" section: ![Embedding PSPDFKit](screenshots/embedding-pspdfkit.png) -12. Add a new `Run Script Phase` in your target’s `Build Phases`. +13. Add a new `Run Script Phase` in your target’s `Build Phases`. **IMPORTANT:** Make sure this `Run Script Phase` is below the `Embed Frameworks` build phase. You can drag and drop build phases to rearrange them. Paste the following line in the script text field of `Run Script Phase`: @@ -52,9 +53,9 @@ Paste the following line in the script text field of `Run Script Phase`: bash "$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/PSPDFKit.framework/strip-framework.sh" ``` ![Run Script Phase](screenshots/run-script-phase.png) -13. Add a PDF by drag and dropping it into your Xcode project (Select "Create groups" and add to target "YourApp"). This will add the document to the "Copy Bundle Resources" build phase: +14. Add a PDF by drag and dropping it into your Xcode project (Select "Create groups" and add to target "YourApp"). This will add the document to the "Copy Bundle Resources" build phase: ![Adding PDF](screenshots/adding-pdf.png) -14. Replace the default component from `App.js` with a simple touch area to present the bundled PDF. (Note that you can also use a [Native UI Component](#native-ui-component) to show a PDF.) +15. Replace the default component from `App.js` with a simple touch area to present the bundled PDF. (Note that you can also use a [Native UI Component](#native-ui-component) to show a PDF.) ```javascript import React, { Component } from 'react'; diff --git a/screenshots/deployment-target.png b/screenshots/deployment-target.png index bd9d193d..ac5caf1a 100644 Binary files a/screenshots/deployment-target.png and b/screenshots/deployment-target.png differ