Skip to content

Commit 8811870

Browse files
authored
Update for PSPDFKit 9.4 for iOS (#369)
1 parent a86f185 commit 8811870

18 files changed

+54
-279
lines changed

README.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ To make sure this is fast, please use a work email and have someone from your co
3737

3838
#### Requirements
3939

40-
- Xcode 11.3.1
41-
- PSPDFKit 9.2.0 for iOS or later
42-
- react-native >= 0.61.5
43-
- CocoaPods >= 1.8.4
40+
- Xcode 11.5
41+
- PSPDFKit 9.4.0 for iOS or later
42+
- react-native >= 0.62.2
43+
- CocoaPods >= 1.9.3
4444

4545
#### Getting Started
4646

4747
Let's create a simple app that integrates PSPDFKit and uses the `react-native-pspdfkit` module.
4848

4949
1. Make sure `react-native-cli` is installed: `yarn global add react-native-cli`
50-
2. Create the app with `react-native init YourApp`.
50+
2. Create the app with `react-native init YourApp`
5151
3. Step into your newly created app folder: `cd YourApp`
5252
4. Install `react-native-pspdfkit` from GitHub: `yarn add github:PSPDFKit/react-native`
5353
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.)
54-
6. Open `ios/Podile` in a text editor: `open ios/Podfile`, update the platform to iOS 11, and add your CocoaPods URL.
54+
6. Open `ios/Podile` in a text editor: `open ios/Podfile`, update the platform to iOS 12, and add the PSPDFKit podspecs:
5555

5656
```diff
5757
- platform :ios, '9.0'
58-
+ platform :ios, '11.0'
58+
+ platform :ios, '12.0'
5959
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
6060

6161
target 'YourApp' do
@@ -85,16 +85,16 @@ target 'YourApp' do
8585
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
8686
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
8787

88-
+ pod 'react-native-pspdfkit', :path => '../node_modules/react-native-pspdfkit'
89-
+ pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/cocoapods/YOUR_COCOAPODS_KEY_GOES_HERE/pspdfkit/latest.podspec'
88+
+ pod 'react-native-pspdfkit', :path => '../node_modules/react-native-pspdfkit/react-native-pspdfkit.podspec'
89+
+ pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/pspdfkit-ios/latest.podspec'
9090

9191
use_native_modules!
9292
end
9393
```
9494

9595
7. `cd ios` then run `pod install`.
9696
8. Open `YourApp.xcworkspace` in Xcode: `open YourApp.xcworkspace`.
97-
9. Make sure the deployment target is set to 11.0 or higher:
97+
9. Make sure the deployment target is set to 12.0 or higher:
9898
![Deployment Target](screenshots/deployment-target.png)
9999
10. Change "View controller-based status bar appearance" to `YES` in `Info.plist`:
100100
![View Controller-Based Status Bar Appearance](screenshots/view-controller-based-status-bar-appearance.png)
@@ -275,11 +275,9 @@ Take a look at the [instructions to get started here](/samples/NativeCatalog/REA
275275

276276
#### Running on Mac Catalyst
277277

278-
Using PSPDFKit React Native Wrapper on Mac Catalyst is not fully supported yet. We plan on adding full support for Mac Catalyst as soon as React Native and CocoaPods will full support Mac Catalyst.
279-
280-
For more details, see [why we don't fully support Mac Catalyst yet here](ios/Experimental_Mac_Catalyst_Support.md#why-is-mac-catalyst-not-fully-supported-yet).
278+
Using PSPDFKit React Native Wrapper on Mac Catalyst does not currently work due to a [Flipper and FlipperKit issue](https://github.com/facebook/react-native/issues/28810).
281279

282-
If you wish to try the experimental Support for Mac Catalyst, please follow [the instructions here.](ios/Experimental_Mac_Catalyst_Support.md)
280+
If you wish to run your project on Mac Catalyst, please try the [following workaround which removes everything related to Flipper and FlipperKit](https://github.com/facebook/react-native/issues/28810#issuecomment-623357732).
283281

284282
#### Configuration Mapping
285283

ios/Experimental_Mac_Catalyst_Support.md

Lines changed: 0 additions & 194 deletions
This file was deleted.

ios/RCTPSPDFKit.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
"$(SRCROOT)/../../react-native/React/**",
287287
"$(SRCROOT)/../samples/Catalog/node_modules/react-native/React/**",
288288
);
289-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
289+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
290290
MTL_ENABLE_DEBUG_INFO = YES;
291291
ONLY_ACTIVE_ARCH = YES;
292292
SDKROOT = iphoneos;
@@ -344,7 +344,7 @@
344344
"$(SRCROOT)/../../react-native/React/**",
345345
"$(SRCROOT)/../samples/Catalog/node_modules/react-native/React/**",
346346
);
347-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
347+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
348348
MTL_ENABLE_DEBUG_INFO = NO;
349349
SDKROOT = iphoneos;
350350
VALIDATE_PRODUCT = YES;

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-pspdfkit",
3-
"version": "1.29.2",
3+
"version": "1.29.3",
44
"description": "A React Native module for the PSPDFKit library.",
55
"keywords": [
66
"react native",

samples/Catalog/ios/Catalog.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@
12481248
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
12491249
"$(SRCROOT)/../node_modules/react-native/React/**",
12501250
);
1251-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
1251+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
12521252
MTL_ENABLE_DEBUG_INFO = YES;
12531253
ONLY_ACTIVE_ARCH = YES;
12541254
SDKROOT = iphoneos;
@@ -1299,7 +1299,7 @@
12991299
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
13001300
"$(SRCROOT)/../node_modules/react-native/React/**",
13011301
);
1302-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
1302+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
13031303
MTL_ENABLE_DEBUG_INFO = NO;
13041304
SDKROOT = iphoneos;
13051305
VALIDATE_PRODUCT = YES;

samples/Catalog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Catalog",
3-
"version": "1.29.2",
3+
"version": "1.29.3",
44
"private": true,
55
"scripts": {
66
"start": "react-native start",

samples/NativeCatalog/README.md

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,52 +24,9 @@ maven {
2424
### Running this Sample on iOS
2525

2626
1. Clone the repository. `git clone https://github.com/PSPDFKit/react-native.git`.
27-
2. Install dependencies: run `yarn install` from `samples/NativeCatalog` directory.
28-
3. Open `samples/NativeCatalog/ios/Podile` in a text editor: `open samples/NativeCatalog/ios/Podfile` and add your CocoaPods URL.
29-
30-
```diff
31-
platform :ios, '11.0'
32-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33-
34-
target 'YourApp' do
35-
# Pods for YourApp
36-
pod 'React', :path => '../node_modules/react-native/'
37-
pod 'React-Core', :path => '../node_modules/react-native/React'
38-
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
39-
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
40-
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
41-
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
42-
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
43-
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
44-
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
45-
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
46-
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
47-
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
48-
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
49-
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
50-
51-
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
52-
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
53-
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
54-
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
55-
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
56-
57-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
58-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
59-
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
60-
61-
pod 'react-native-pspdfkit', :path => '../node_modules/react-native-pspdfkit'
62-
- pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/cocoapods/YOUR_COCOAPODS_KEY_GOES_HERE/pspdfkit/latest.podspec'
63-
+ pod 'PSPDFKit', podspec: 'https://customers.pspdfkit.com/cocoapods/USE_YOUR_OWN_COCOAPODS_KEY/pspdfkit/latest.podspec'
64-
- pod 'Instant', podspec:'https://customers.pspdfkit.com/cocoapods/YOUR_COCOAPODS_KEY_GOES_HERE/instant/latest.podspec'
65-
+ pod 'Instant', podspec:'https://customers.pspdfkit.com/cocoapods/USE_YOUR_OWN_COCOAPODS_KEY/instant/latest.podspec'
66-
67-
use_native_modules!
68-
end
69-
```
70-
71-
4. `cd ios` then run `pod install`.
72-
5. The Native Catalog app is now ready to launch. From `samples/NativeCatalog` directory run `react-native run-ios`.
27+
2. Install dependencies: run `yarn install` from the `samples/NativeCatalog` directory.
28+
3. `cd ios` then run `pod install`.
29+
4. The Native Catalog app is now ready to launch. From `samples/NativeCatalog` directory run `react-native run-ios`.
7330

7431
### Examples
7532

@@ -84,3 +41,7 @@ This example shows you how to use the `PdfProcessor` on Android and `PSPDFRender
8441
#### Watermark on Startup
8542

8643
This example shows you how to use the `PdfProcessor` on Android and `PSPDFRenderDrawBlock` on iOS to put a watermark on the currently displayed document on startup, save it to a new path, and display it. The relevant part is the `performWatermarking` method in the `CustomPdfViewManager` and `-[CustomPDFViewcreateWatermarkAndReloadData:]` on iOS.
44+
45+
#### Instant Example
46+
47+
In this example, we bridged the native iOS Instant example from [PSPDFKit Catalog](https://pspdfkit.com/guides/ios/current/getting-started/example-projects/#pspdfcatalog) over to React Natice.

0 commit comments

Comments
 (0)