Skip to content

Commit

Permalink
Update for PSPDFKit 10.5 for iOS (#409)
Browse files Browse the repository at this point in the history
* Update for PSPDFKit 10.5 for iOS

* Bump version number to 1.31.5

* Fix link
  • Loading branch information
radazzouz authored Jul 7, 2021
1 parent 227b83a commit 2bdacfd
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 55 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ yarn add github:PSPDFKit/react-native
yarn install
```

6. Open your project’s Podfile in a text editor to update the platform to iOS 12, and add the PSPDFKit Podspec:
6. Open your project’s Podfile in a text editor to update the platform to iOS 13, and add the PSPDFKit Podspec:

```bash
open ios/Podfile
Expand All @@ -90,7 +90,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

- platform :ios, '10.0'
+ platform :ios, '12.0'
+ platform :ios, '13.0'

target 'PSPDFKitDemo' do
config = use_native_modules!
Expand Down Expand Up @@ -137,7 +137,7 @@ pod install
open PSPDFKitDemo.xcworkspace
```

7. Make sure the deployment target is set to 12.0 or higher:
7. Make sure the deployment target is set to 13.0 or higher:

![deployment-target](/screenshots/deployment-target.png)

Expand Down
4 changes: 2 additions & 2 deletions ios/RCTPSPDFKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
"$(SRCROOT)/../../react-native/React/**",
"$(SRCROOT)/../samples/Catalog/node_modules/react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -346,7 +346,7 @@
"$(SRCROOT)/../../react-native/React/**",
"$(SRCROOT)/../samples/Catalog/node_modules/react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
1 change: 0 additions & 1 deletion ios/RCTPSPDFKit/Converters/RCTConvert+PSPDFConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ - (void)setupFromJSON:(id)json {
SET(createAnnotationMenuEnabled, BOOL)
SET(naturalDrawingAnnotationEnabled, BOOL)
SET(drawCreateMode, PSPDFDrawCreateMode)
SET(showAnnotationMenuAfterCreation, BOOL)
SET(shouldAskForAnnotationUsername, BOOL)
SET(annotationEntersEditModeAfterSecondTapEnabled, BOOL)
SET(autosaveEnabled, BOOL)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pspdfkit",
"version": "1.31.4",
"version": "1.31.5",
"description": "A React Native module for the PSPDFKit library.",
"keywords": [
"react native",
Expand Down
2 changes: 1 addition & 1 deletion react-native-pspdfkit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pod::Spec.new do |s|
s.authors = ["PSPDFKit"]
s.homepage = "https://github.com/PSPDFKit/react-native#readme"
s.license = package['license']
s.platform = :ios, "11.0"
s.platform = :ios, "13.0"
s.module_name = 'PSPDFKitReactNativeiOS'
s.source = { :git => "https://github.com/PSPDFKit/react-native" }
s.source_files = "ios/*.{xcodeproj}", "ios/RCTPSPDFKit/*.{h,m,swift}", "ios/RCTPSPDFKit/Converters/*.{h,m,swift}"
Expand Down
46 changes: 19 additions & 27 deletions samples/Catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,19 @@ The project contains a large set of sample code, which illustrates how to set up

#### Requirements

- Android SDK
- Android NDK
- Android Build Tools 23.0.1 (React Native)
- Android Build Tools 28.0.3 (PSPDFKit module)
- Android Gradle plugin 3.4.1 or later.
- PSPDFKit for Android 6.6.0 or later.
- The [latest stable version of Android Studio](https://developer.android.com/studio).
- The [Android NDK](https://developer.android.com/studio/projects/install-ndk).
- An [Android Virtual Device](Android Virtual Device) or a hardware device.
- React Native 0.60.4.

#### Getting Started

1. Clone the repository. `git clone https://github.com/PSPDFKit/react-native.git`.
2. Install dependencies: run `yarn install` from `samples/Catalog` directory. (Because of a [bug](https://github.com/yarnpkg/yarn/issues/2165) you may need to clean `yarn`'s cache with `yarn cache clean` before.)
3. Update license key in `samples/Catalog/android/app/src/main/AndroidManifest.xml`:

```xml
<application>
...

<meta-data
android:name="pspdfkit_license_key"
android:value="YOUR_LICENSE_KEY_GOES_HERE"/>

</application>
```

4. Catalog app is now ready to launch. From `samples/Catalog` directory run `react-native run-android`.
1. Clone the repository: `git clone https://github.com/PSPDFKit/react-native.git`.
2. Step into the Catalog project's directory: `cd react-native/samples/Catalog`
3. Install dependencies: run `yarn install`.
4. [Start your emulator](https://developer.android.com/studio/run/emulator#runningemulator).
5. Start the Metro bundler by running `react-native start`.
6. Catalog app is now ready to launch. From `samples/Catalog` directory run `react-native run-android`.

### Running the Catalog on iOS

Expand All @@ -44,10 +31,15 @@ The project contains a large set of sample code, which illustrates how to set up
#### Getting Started

1. Clone the repository: `git clone https://github.com/PSPDFKit/react-native.git`.
2. Step into your newly cloned folder: `cd react-native` and create a new `PSPDFKit` directory: `mkdir PSPDFKit`.
3. [Download the latest version of PSPDFKit for iOS](https://customers.pspdfkit.com/download/binary/ios/latest) and mount the DMG file.
4. Copy `PSPDFKit.xcframework` and `PSPDFKitUI.xcframework` into the `PSPDFKit` directory.
5. Install dependencies: `yarn install` in `samples/Catalog` directory. (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. Run the app with `react-native-cli`: `react-native run-ios`
2. Step into your newly cloned folder: `cd react-native`
3. Create a new `PSPDFKit` directory: `mkdir PSPDFKit`.
4. [Download the latest version of PSPDFKit for iOS](https://customers.pspdfkit.com/download/binary/ios/latest) and mount the DMG file.
5. Copy `PSPDFKit.xcframework` and `PSPDFKitUI.xcframework` into the `PSPDFKit` directory.
6. Step into the Catalog project's directory: `cd /samples/Catalog`
7. Install dependencies: `yarn install` in `samples/Catalog` directory. (Because of a [bug](https://github.com/yarnpkg/yarn/issues/2165) you may need to clean `yarn`'s cache with `yarn cache clean` before.)
8. Start the Metro bundler by running `react-native start`
9. Run the app with `react-native-cli`: `react-native run-ios`

### Troubleshooting

**Note:** If you get an error about `config.h` not being found check out [this blog post](https://tuntunir.blogspot.com/2018/02/react-native-fatal-error-configh-file.html) for information on how to fix it.
6 changes: 3 additions & 3 deletions samples/Catalog/ios/Catalog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@
"$(inherited)",
);
INFOPLIST_FILE = CatalogTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1249,7 +1249,7 @@
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1301,7 +1301,7 @@
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
2 changes: 1 addition & 1 deletion samples/Catalog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Catalog",
"version": "1.31.4",
"version": "1.31.5",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down
2 changes: 1 addition & 1 deletion samples/Catalog/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5415,7 +5415,7 @@ react-native-permissions@^1.1.1:
integrity sha512-t0Ujm177bagjUOSzhpmkSz+LqFW04HnY9TeZFavDCmV521fQvFz82aD+POXqWsAdsJVOK3umJYBNNqCjC3g0hQ==

"react-native-pspdfkit@file:../..":
version "1.31.4"
version "1.31.5"

react-native-qrcode-scanner@^1.2.1:
version "1.2.1"
Expand Down
32 changes: 25 additions & 7 deletions samples/NativeCatalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,34 @@ This second Catalog example serves to show you how you can leverage `PdfView` (A

### Running this Sample on Android

1. Clone the repository. `git clone https://github.com/PSPDFKit/react-native.git`.
2. Install dependencies: run `yarn install` from `samples/NativeCatalog` directory.
3. The Native Catalog app is now ready to launch. From `samples/NativeCatalog` directory run `react-native run-android`.
#### Requirements

- A [development environment](https://reactnative.dev/docs/environment-setup) for running React Native projects using the React Native CLI (not the Expo CLI).
- The [latest stable version of Android Studio](https://developer.android.com/studio).
- The [Android NDK](https://developer.android.com/studio/projects/install-ndk).
- An [Android Virtual Device](Android Virtual Device) or a hardware device.

#### Getting Started

1. Clone the repository: `git clone https://github.com/PSPDFKit/react-native.git`.
2. Step into the NativeCatalog project's directory: `cd react-native/samples/NativeCatalog`.
3. Install dependencies: run `yarn install`.
4. The Native Catalog app is now ready to launch: `react-native run-android`.

### Running this Sample on iOS

1. Clone the repository. `git clone https://github.com/PSPDFKit/react-native.git`.
2. Install dependencies: run `yarn install` from the `samples/NativeCatalog` directory.
3. `cd ios` then run `pod install`.
4. The Native Catalog app is now ready to launch. From `samples/NativeCatalog` directory run `react-native run-ios`.
- A [development environment](https://reactnative.dev/docs/environment-setup) for running React Native projects using the React Native CLI (not the Expo CLI).
- The [latest stable version of Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12).
- The [latest stable version of CocoaPods](https://github.com/CocoaPods/CocoaPods/releases). If you don’t already have CocoaPods installed, follow the [CocoaPods installation guide](https://guides.cocoapods.org/using/getting-started.html#installation) to install CocoaPods on your Mac.

#### Getting Started

1. Clone the repository: `git clone https://github.com/PSPDFKit/react-native.git`.
2. Step into the `NativeCatalog` project's directory: `cd react-native/samples/NativeCatalog`.
3. Install dependencies: run `yarn install`.
4. `cd ios` then run `pod install`.
5. Step back into the `NativeCatalog` project's directory: `cd ..`.
6. The Native Catalog app is now ready to launch: `react-native run-ios`.

### Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
"$(inherited)",
);
INFOPLIST_FILE = NativeCatalogTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
Expand All @@ -489,7 +489,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = NativeCatalogTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -602,7 +602,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -650,7 +650,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
2 changes: 1 addition & 1 deletion samples/NativeCatalog/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '12.0'
platform :ios, '13.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'NativeCatalog' do
Expand Down
2 changes: 1 addition & 1 deletion samples/NativeCatalog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "NativeCatalog",
"version": "1.31.4",
"version": "1.31.5",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
2 changes: 1 addition & 1 deletion samples/NativeCatalog/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5506,7 +5506,7 @@ react-native-gesture-handler@^1.3.0:
prop-types "^15.7.2"

"react-native-pspdfkit@file:../..":
version "1.31.4"
version "1.31.5"

react-native-safe-area-view@^0.14.1:
version "0.14.8"
Expand Down
Binary file modified screenshots/deployment-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2bdacfd

Please sign in to comment.