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
+43-5Lines changed: 43 additions & 5 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 (note **three** 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
...
@@ -158,6 +158,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
158
158
159
159
defaultConfig {
160
160
applicationId "com.yourapp"
161
+
+ multiDexEnabled true
161
162
minSdkVersion 16
162
163
- targetSdkVersion 22
163
164
+ targetSdkVersion 25
@@ -170,7 +171,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
170
171
...
171
172
```
172
173
173
-
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:
174
175
175
176
```diff
176
177
<application>
@@ -191,7 +192,7 @@ with
191
192
```xml
192
193
<itemname="colorPrimary">#3C97C9</item>
193
194
```
194
-
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:
195
196
196
197
```javascript
197
198
importReact, { Component } from'react';
@@ -281,7 +282,7 @@ with
281
282
282
283
1. Clone the repository. `git clone https://github.com/PSPDFKit/react-native.git`.
283
284
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.)
284
-
3. Add your customer portal password to `samples/Catalog/build.gradle`:
285
+
3. Add your customer portal password to `samples/Catalog/android/build.gradle`:
285
286
286
287
```groovy
287
288
maven {
@@ -337,6 +338,43 @@ const CONFIGURATION = {
337
338
};
338
339
```
339
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