Skip to content

Commit a63f88f

Browse files
Update to PSPDFKit 6.5 for Android (#373)
* Update to PSPDFKit 6.5 for Android * Remove Maven password requirement * Bump version to 1.29.7
2 parents bb2dbe9 + 840756e commit a63f88f

File tree

9 files changed

+18
-106
lines changed

9 files changed

+18
-106
lines changed

README.md

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -391,35 +391,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
391391
3. Step into your newly created app folder: `cd YourApp`.
392392
4. Add `react-native-pspdfkit` module from GitHub: `yarn add github:PSPDFKit/react-native`.
393393
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.)
394-
6. <a id="step-7"></a>Add PSPDFKit repository to `YourApp/android/build.gradle` so PSPDFKit library can be downloaded:
395-
396-
```diff
397-
allprojects {
398-
repositories {
399-
mavenLocal()
400-
+ maven {
401-
+ url 'https://customers.pspdfkit.com/maven/'
402-
+ credentials {
403-
+ username 'pspdfkit'
404-
+ password 'YOUR_MAVEN_KEY_GOES_HERE'
405-
+ }
406-
+ }
407-
maven {
408-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
409-
url "$rootDir/../node_modules/react-native/android"
410-
}
411-
maven {
412-
// Android JSC is installed from npm
413-
url("$rootDir/../node_modules/jsc-android/dist")
414-
}
415-
416-
google()
417-
jcenter()
418-
}
419-
}
420-
```
421-
422-
7. PSPDFKit targets modern platforms, so you'll have to set the `minSdkVersion` to 19. In `YourApp/android/build.gradle`:
394+
6. PSPDFKit targets modern platforms, so you'll have to set the `minSdkVersion` to 19. In `YourApp/android/build.gradle`:
423395

424396
```diff
425397
...
@@ -434,7 +406,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
434406
...
435407
```
436408

437-
8. We will also need to enable MultiDex support. In `YourApp/android/app/build.gradle`:
409+
7. We will also need to enable MultiDex support. In `YourApp/android/app/build.gradle`:
438410

439411
```diff
440412
...
@@ -449,7 +421,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
449421
...
450422
```
451423

452-
9. <a id="step-10"></a>Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
424+
8. <a id="step-10"></a>Enter your PSPDFKit license key into `YourApp/android/app/src/main/AndroidManifest.xml` file:
453425

454426
```diff
455427
<application>
@@ -462,7 +434,7 @@ Let's create a simple app that integrates PSPDFKit and uses the react-native-psp
462434
</application>
463435
```
464436

465-
10. Set primary color. In `YourApp/android/app/src/main/res/values/styles.xml` replace
437+
9. Set primary color. In `YourApp/android/app/src/main/res/values/styles.xml` replace
466438

467439
```xml
468440
<!-- Customize your theme here. -->
@@ -474,7 +446,7 @@ with
474446
<item name="colorPrimary">#3C97C9</item>
475447
```
476448

477-
11. <a id="step-12"></a>Replace the default component from `YourApp/App.js` with a simple touch area to present a PDF document from the local device filesystem:
449+
10. <a id="step-12"></a>Replace the default component from `YourApp/App.js` with a simple touch area to present a PDF document from the local device filesystem:
478450

479451
```javascript
480452
import React, { Component } from "react";
@@ -545,13 +517,13 @@ const styles = StyleSheet.create({
545517
});
546518
```
547519

548-
12. Before launching the app you need to copy a PDF document onto your development device or emulator.
520+
11. Before launching the app you need to copy a PDF document onto your development device or emulator.
549521

550522
```bash
551523
adb push /path/to/your/document.pdf /sdcard/document.pdf
552524
```
553525

554-
13. Your app is now ready to launch. From `YourApp` directory run `react-native run-android`.
526+
12. Your app is now ready to launch. From `YourApp` directory run `react-native run-android`.
555527

556528
```bash
557529
react-native run-android
@@ -561,20 +533,7 @@ const styles = StyleSheet.create({
561533

562534
1. Clone the repository. `git clone https://github.com/PSPDFKit/react-native.git`.
563535
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.)
564-
3. Add your customer portal password to `samples/Catalog/android/build.gradle`:
565-
566-
```groovy
567-
maven {
568-
url 'https://customers.pspdfkit.com/maven/'
569-
570-
credentials {
571-
username 'pspdfkit'
572-
password 'YOUR_MAVEN_PASSWORD_GOES_HERE'
573-
}
574-
}
575-
```
576-
577-
4. Update license key in `samples/Catalog/android/app/src/main/AndroidManifest.xml`:
536+
3. Update license key in `samples/Catalog/android/app/src/main/AndroidManifest.xml`:
578537
579538
```xml
580539
<application>
@@ -587,7 +546,7 @@ const styles = StyleSheet.create({
587546
</application>
588547
```
589548
590-
5. Catalog app is now ready to launch. From `samples/Catalog` directory run `react-native run-android`.
549+
4. Catalog app is now ready to launch. From `samples/Catalog` directory run `react-native run-android`.
591550
592551
#### Running the Native Catalog
593552

android/build.gradle

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

88
buildscript {
@@ -11,6 +11,9 @@ buildscript {
1111
maven {
1212
url 'https://maven.google.com'
1313
}
14+
maven {
15+
url 'https://customers.pspdfkit.com/maven'
16+
}
1417
}
1518

1619
dependencies {
@@ -41,33 +44,6 @@ android {
4144
}
4245
}
4346

44-
def demoVersion = false;
45-
project.repositories.each {
46-
if (it instanceof MavenArtifactRepository) {
47-
if ("$it.url".contains("customers.pspdfkit.com/maven")) {
48-
// Bug: https://github.com/gradle/gradle/issues/1230
49-
def username = it.credentials.username
50-
def password = it.credentials.password
51-
52-
if (username == "pspdfkit") {
53-
if (password != null && password.startsWith("TRIAL")) {
54-
demoVersion = true;
55-
} else if (password != null && password == "YOUR_MAVEN_PASSWORD_GOES_HERE") {
56-
println "#######################################################################################################"
57-
println "### Credentials error: edit 'YourApp/android/build.gradle' file and modify PSPDFKit maven password. ###"
58-
println "#######################################################################################################"
59-
}
60-
}
61-
}
62-
}
63-
}
64-
65-
if (demoVersion) {
66-
println "##############################"
67-
println "### PSPDFKit Demo Version. ###"
68-
println "##############################"
69-
}
70-
7147
dependencies {
7248
api("com.pspdfkit:pspdfkit:${PSPDFKIT_VERSION}") {
7349
exclude group: 'com.google.auto.value', module: 'auto-value'

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

samples/Catalog/android/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ allprojects {
2424
jcenter()
2525
maven {
2626
url 'https://customers.pspdfkit.com/maven/'
27-
28-
credentials {
29-
username 'pspdfkit'
30-
password 'YOUR_MAVEN_KEY_GOES_HERE'
31-
}
3227
}
3328
maven {
3429
// Android JSC is installed from npm

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.6",
3+
"version": "1.29.7",
44
"private": true,
55
"scripts": {
66
"start": "react-native start",

samples/NativeCatalog/README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,7 @@ This second, Android only, Catalog example serves to show you how you can levera
66

77
1. Clone the repository. `git clone https://github.com/PSPDFKit/react-native.git`.
88
2. Install dependencies: run `yarn install` from `samples/NativeCatalog` directory.
9-
3. Add your customer portal password to `samples/NativeCatalog/android/build.gradle`:
10-
11-
```groovy
12-
maven {
13-
url 'https://customers.pspdfkit.com/maven/'
14-
15-
credentials {
16-
username 'pspdfkit'
17-
password 'YOUR_MAVEN_PASSWORD_GOES_HERE'
18-
}
19-
}
20-
```
21-
22-
4. The Native Catalog app is now ready to launch. From `samples/NativeCatalog` directory run `react-native run-android`.
9+
3. The Native Catalog app is now ready to launch. From `samples/NativeCatalog` directory run `react-native run-android`.
2310

2411
### Running this Sample on iOS
2512

samples/NativeCatalog/android/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ allprojects {
3535
jcenter()
3636
maven {
3737
url 'https://customers.pspdfkit.com/maven/'
38-
39-
credentials {
40-
username 'pspdfkit'
41-
password 'YOUR_MAVEN_KEY_GOES_HERE'
42-
}
4338
}
4439
maven { url 'https://jitpack.io' }
4540
}

samples/NativeCatalog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "NativeCatalog",
3-
"version": "1.29.6",
3+
"version": "1.29.7",
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",

0 commit comments

Comments
 (0)