$ npm install react-native-avs --save
$ react-native link react-native-avs
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNAvsPackage;
to the imports at the top of the file - Add
new RNAvsPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-avs' project(':react-native-avs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-avs/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-avs')
- Currently, we'll have to increase the min-sdk version of andorid to 21 from 16 which involves changing the android/app/src/main/AndroidManifest.xml file. Edit the
android:minSdkVersion="16"
line from 16 to 21. - Add the
multiDexEnabled true
line to android/app/build.gradle file
android {
defaultConfig {
multiDexEnabled true
...
}
...
}
- Follow the process for creating a connected device detailed in https://developer.amazon.com/appsandservices/solutions/alexa/alexa-voice-service/getting-started-with-the-alexa-voice-service
- Follow the instructions for adding your key and preparing the Login with Amazon activity from the 'Login with Amazon' Android Project guide
- Add your api_key.txt file (part of the Login with Amazon process detailed in the link above) to the app/src/main/assets folder.
- Start integration and testing!
import RNAvs from 'react-native-avs';
// TODO: What to do with the module?
RNAvs;