Skip to content

Commit 0960f30

Browse files
committed
Add Update section
Signed-off-by: Simone Arpe <[email protected]>
1 parent 85c4bf8 commit 0960f30

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
123123
3. Step into your newly created app folder: `cd YourApp`.
124124
4. Install `react-native-pspdfkit` from GitHub: `yarn add github:PSPDFKit/react-native`.
125125
5. Link module `react-native-pspdfkit`: `react-native link react-native-pspdfkit`.
126-
6. Add PSPDFKit repository to `YourApp/android/build.gradle` so PSPDFKit library can be downloaded:
126+
6. <a id="step-6"></a>Add PSPDFKit repository to `YourApp/android/build.gradle` so PSPDFKit library can be downloaded:
127127

128128
```diff
129129
allprojects {
@@ -146,7 +146,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
146146
}
147147
```
148148

149-
7. PSPDFKit targets modern platforms, so you'll have to update `compileSdkVersion` and `targetSdkVersion` to at least API 25 and enable MultiDex. From `YourApp/android/app/build.gradle` (note **four** places to edit):
149+
7. PSPDFKit targets modern platforms, so you'll have to update `compileSdkVersion` and `targetSdkVersion` to at least API 25 and enable MultiDex. In `YourApp/android/app/build.gradle` (note **four** places to edit):
150150

151151
```diff
152152
...
@@ -171,7 +171,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
171171
...
172172
```
173173
174-
8. Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
174+
8. <a id="step-8"></a>Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
175175

176176
```diff
177177
<application>
@@ -192,7 +192,7 @@ with
192192
```xml
193193
<item name="colorPrimary">#3C97C9</item>
194194
```
195-
10. Replace the default component from `YourApp/index.android.js` with a simple touch area to present a PDF document from the local device filesystem:
195+
10. <a id="step-10"></a>Replace the default component from `YourApp/index.android.js` with a simple touch area to present a PDF document from the local device filesystem:
196196

197197
```javascript
198198
import React, { Component } from 'react';
@@ -338,6 +338,43 @@ const CONFIGURATION = {
338338
};
339339
```
340340

341+
#### Update
342+
Upgrading yarn's lock file is required in order to update react-native-pspdfkit module in a project that has been already setup following the steps in [Getting Started](#getting-started) section.
343+
From root project folder (e.g.`YourApp` for upgrading example project) launch `yarn upgrade`.
344+
345+
##### Migrate from PSPDFKit version 2.9.x to 3.0.0
346+
After launching `yarn upgrade`, apply [step 6](#step-6), [step 8](#step-8) and [step 10](#step-10) from [Getting Started](#getting-started) section.
347+
Enable MultiDex in `YourApp/android/app/build.gradle` (note **one** place to edit):
348+
349+
```diff
350+
...
351+
android {
352+
compileSdkVersion 25
353+
buildToolsVersion "25.0.2"
354+
355+
defaultConfig {
356+
applicationId "com.yourapp"
357+
+ multiDexEnabled true
358+
minSdkVersion 16
359+
targetSdkVersion 25
360+
versionCode 1
361+
versionName "1.0"
362+
ndk {
363+
abiFilters "armeabi-v7a", "x86"
364+
}
365+
}
366+
...
367+
```
368+
Remove `pspdfkit-lib` folder in `YourApp/android/`.
369+
In `YourApp/android/settings.gradle` remove the old reference to `pspdfkit-lib` (note **one** place to edit):
370+
371+
```diff
372+
project(':react-native-pspdfkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pspdfkit/android')
373+
include ':app'
374+
-include ':pspdfkit-lib'
375+
```
376+
377+
341378
#### API
342379
343380
##### Constants

0 commit comments

Comments
 (0)