Skip to content

Commit c60c144

Browse files
authored
Merge pull request #72 from PSPDFKit/simone/issue/upgrade-react-native-0.55.4
Upgrade to React Native 0.55.4
2 parents 7269fe0 + 2ac51a2 commit c60c144

File tree

14 files changed

+553
-112
lines changed

14 files changed

+553
-112
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ editableAnnotationTypes: ['Ink', 'Highlight']
247247
- Android SDK
248248
- Android Build Tools 23.0.1 (React Native)
249249
- Android Build Tools 26.0.1 (PSPDFKit module)
250-
- PSPDFKit >= 4.4.1
251-
- react-native >= 0.54.2
250+
- PSPDFKit >= 4.6.0
251+
- react-native >= 0.55.4
252252

253253
#### Getting Started
254254

@@ -257,9 +257,10 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
257257
1. Make sure `react-native-cli` is installed: `yarn global add react-native-cli`
258258
2. Create the app with `react-native init YourApp`.
259259
3. Step into your newly created app folder: `cd YourApp`.
260-
4. Install `react-native-pspdfkit` from GitHub: `yarn add github:PSPDFKit/react-native`.
261-
5. Link module `react-native-pspdfkit`: `react-native link react-native-pspdfkit`.
262-
6. <a id="step-6"></a>Add PSPDFKit and Google repository to `YourApp/android/build.gradle` so PSPDFKit library and Android dependencies can be downloaded:
260+
4. Add `react-native-pspdfkit` module from GitHub: `yarn add github:PSPDFKit/react-native`.
261+
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.)
262+
6. Link module `react-native-pspdfkit`: `react-native link react-native-pspdfkit`.
263+
7. <a id="step-6"></a>Add PSPDFKit and Google repository to `YourApp/android/build.gradle` so PSPDFKit library and Android dependencies can be downloaded:
263264

264265
```diff
265266
allprojects {
@@ -285,7 +286,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
285286
}
286287
```
287288

288-
7. PSPDFKit targets modern platforms, so you'll have to update `compileSdkVersion` and `targetSdkVersion` to at least API 26 and enable MultiDex. In `YourApp/android/app/build.gradle` (note **five** places to edit):
289+
8. PSPDFKit targets modern platforms, so you'll have to update `compileSdkVersion` and `targetSdkVersion` to at least API 26 and enable MultiDex. In `YourApp/android/app/build.gradle` (note **five** places to edit):
289290

290291
```diff
291292
...
@@ -311,7 +312,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
311312
...
312313
```
313314
314-
8. <a id="step-8"></a>Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
315+
9. <a id="step-8"></a>Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
315316

316317
```diff
317318
<application>
@@ -324,15 +325,15 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
324325
</application>
325326
```
326327

327-
9. Set primary color. In `YourApp/android/app/src/main/res/values/styles.xml` replace
328+
10. Set primary color. In `YourApp/android/app/src/main/res/values/styles.xml` replace
328329
```xml
329330
<!-- Customize your theme here. -->
330331
```
331332
with
332333
```xml
333334
<item name="colorPrimary">#3C97C9</item>
334335
```
335-
10. <a id="step-10"></a>Replace the default component from `YourApp/App.js` with a simple touch area to present a PDF document from the local device filesystem:
336+
11. <a id="step-10"></a>Replace the default component from `YourApp/App.js` with a simple touch area to present a PDF document from the local device filesystem:
336337

337338
```javascript
338339
import React, { Component } from 'react';
@@ -403,13 +404,13 @@ with
403404
}
404405
});
405406
```
406-
11. Before launching the app you need to copy a PDF document onto your development device or emulator.
407+
12. Before launching the app you need to copy a PDF document onto your development device or emulator.
407408

408409
```bash
409410
adb push /path/to/your/document.pdf /sdcard/document.pdf
410411
```
411412

412-
12. Your app is now ready to launch. From `YourApp` directory run `react-native run-android`.
413+
13. Your app is now ready to launch. From `YourApp` directory run `react-native run-android`.
413414

414415
```bash
415416
react-native run-android

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Contains gradle configuration constants
33
*/
44
ext {
5-
PSPDFKIT_VERSION = '4.4.1'
5+
PSPDFKIT_VERSION = '4.6.0'
66
}
77

88
buildscript {
@@ -11,7 +11,7 @@ buildscript {
1111
}
1212

1313
dependencies {
14-
classpath 'com.android.tools.build:gradle:2.3.0'
14+
classpath 'com.android.tools.build:gradle:2.3.1'
1515
}
1616
}
1717

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.10.0",
3+
"version": "1.11.0",
44
"description": "A React Native module for the PSPDFKit library.",
55
"keywords": [
66
"react native",

samples/Catalog/.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*
4646
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
4747

4848
[version]
49-
^0.65.0
49+
^0.67.0

samples/Catalog/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,16 @@ buck-out/
4242
android/app/libs
4343
*.keystore
4444

45+
# fastlane
46+
#
47+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48+
# screenshots whenever they are needed.
49+
# For more information about the recommended setup visit:
50+
# https://docs.fastlane.tools/best-practices/source-control/
51+
52+
*/fastlane/report.xml
53+
*/fastlane/Preview.html
54+
*/fastlane/screenshots
55+
56+
# Bundle artifact
57+
*.jsbundle

samples/Catalog/Catalog.android.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ import { StackNavigator } from "react-navigation";
2525

2626
import PSPDFKitView from "react-native-pspdfkit";
2727

28+
// React Native bug that hopefully will be fixed soon:
29+
// https://github.com/facebook/react-native/issues/18868
30+
import { YellowBox } from 'react-native'
31+
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated'])
32+
2833
var PSPDFKit = NativeModules.PSPDFKit;
2934

3035
const pspdfkitColor = "#267AD4";

samples/Catalog/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.0'
8+
classpath 'com.android.tools.build:gradle:2.3.1'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

0 commit comments

Comments
 (0)