react-native-transfer-library
v1.1.24
Published
Transfer Library
Downloads
42
Readme
cannot be used by the community, because this project is for internal purpose only
react-native-transfer-library
Getting started
$ npm install react-native-transfer-library --save
Mostly automatic installation
$ react-native link react-native-transfer-library
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-transfer-library
and addRNTransferLibrary.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNTransferLibrary.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNTransferLibraryPackage;
to the imports at the top of the file - Add
new RNTransferLibraryPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-transfer-library' project(':react-native-transfer-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-transfer-library/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-transfer-library')
AWS Configuration
Android Add a container android/res/raw/awsconfiguration.json file in your project with content lik this:
{
"Version": "1.0",
"IdentityManager": {
"Default": {}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "us-east-X:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"Region": "us-east-X"
}
}
},
"S3TransferUtility": {
"Default": {
"Bucket": "mobile-transfer-bucket",
"Region": "us-east-X"
}
}
}
Permissions
Android
Permission is required to read and write to the external storage.
On react-native-cli or ejected apps, adding the following lines will add the capability for the app to request the permission. Find more info on Android Permissions here.
<manifest>
...
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
...
<application>
Windows
- In Visual Studio add the
RNTransferLibrary.sln
innode_modules/react-native-transfer-library/windows/RNTransferLibrary.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using Transfer.Library.RNTransferLibrary;
to the usings at the top of the file - Add
new RNTransferLibraryPackage()
to theList<IReactPackage>
returned by thePackages
method
Usage
import RNTransferLibrary from 'react-native-transfer-library';
// TODO: What to do with the module?
RNTransferLibrary;