Commit 24f2bf1c349698d3fb639608407c2918bfbef6fe

Authored by Andrei Pfeiffer
Committed by GitHub
1 parent d6871675
Exists in master

Update README.md

Showing 1 changed file with 36 additions and 1 deletions   Show diff stats
README.md
... ... @@ -30,7 +30,7 @@ npm install git+ssh://git@github.com:andreipfeiffer/react-native-webview-android
30 30 react-native link react-native-webview-android-file-upload
31 31 ```
32 32  
33   -The above should make the changes listed below. If it didn't, you should try manual linking.
  33 +The above should make (most of) the changes listed below. If it didn't, you should try manual linking.
34 34  
35 35 ### Manual linking
36 36  
... ... @@ -78,6 +78,41 @@ public class MainApplication extends Application implements ReactApplication {
78 78 }
79 79 ```
80 80  
  81 +* Add file provider path resource `file_provider_paths.xml` in `[your project]/android/app/src/main/res/xml/` folder. If the folder does not exist, create a new one.
  82 +
  83 +```xml
  84 +<?xml version="1.0" encoding="utf-8"?>
  85 +<paths xmlns:android="http://schemas.android.com/apk/res/android">
  86 + <external-path name="shared" path="." />
  87 +</paths>
  88 +```
  89 +
  90 +* Add permissions & configure file provider in `AndroidManifest.xml`:
  91 +
  92 +```html
  93 +<manifest ...>
  94 + ......
  95 +
  96 + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  97 + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  98 +
  99 + <application ...>
  100 + ......
  101 +
  102 + <provider
  103 + android:name="android.support.v4.content.FileProvider"
  104 + android:authorities="${applicationId}.fileprovider"
  105 + android:exported="false"
  106 + android:grantUriPermissions="true">
  107 + <meta-data
  108 + android:name="android.support.FILE_PROVIDER_PATHS"
  109 + android:resource="@xml/file_provider_paths" />
  110 + </provider>
  111 +
  112 + </application>
  113 +</manifest>
  114 +```
  115 +
81 116 ### Re-build your application
82 117  
83 118 Since you have changed native code, reloading the JS code alone won't work:
... ...