You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-4Lines changed: 41 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
123
123
3. Step into your newly created app folder: `cd YourApp`.
124
124
4. Install `react-native-pspdfkit` from GitHub: `yarn add github:PSPDFKit/react-native`.
125
125
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.<aid="step-6"></a>Add PSPDFKit repository to `YourApp/android/build.gradle` so PSPDFKit library can be downloaded:
127
127
128
128
```diff
129
129
allprojects {
@@ -146,7 +146,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
146
146
}
147
147
```
148
148
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):
150
150
151
151
```diff
152
152
...
@@ -171,7 +171,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
171
171
...
172
172
```
173
173
174
-
8. Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
174
+
8.<aid="step-8"></a>Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
175
175
176
176
```diff
177
177
<application>
@@ -192,7 +192,7 @@ with
192
192
```xml
193
193
<itemname="colorPrimary">#3C97C9</item>
194
194
```
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.<aid="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:
196
196
197
197
```javascript
198
198
importReact, { Component } from'react';
@@ -338,6 +338,43 @@ const CONFIGURATION = {
338
338
};
339
339
```
340
340
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')
0 commit comments