Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,29 @@ Find `Search Paths` and add `$(SRCROOT)/../node_modules/react-native-survey-monk

### Android

The Android version doesn't require additional changes, please note that that minSdk for this library is Api 21 (Android 5.x).
The SDK requires a custom __`maven url`__ in the root __`android/build.gradle`__:

### :open_file_folder: **`android/build.gradle`**

```diff
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
+ maven {
+ // react-native-survey-monkey
+ url("${project(':react-native-survey-monkey').projectDir}/libs")
+ }
}
}
```

## Usage

Expand Down
25 changes: 7 additions & 18 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

buildscript {
repositories {
mavenCentral()
google()
}

dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
Expand All @@ -33,14 +22,14 @@ android {
repositories {
mavenCentral()
google()
// maven {
// // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
// url "$rootDir/../node_modules/react-native/android"
// }
maven {
url './libs'
}
}

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.surveymonkey:surveymonkey-android-sdk:2.0.0'
// implementation 'com.surveymonkey:surveymonkey-android-sdk:2.0.0'
implementation(group: 'com.surveymonkey', name:'surveymonkey-android-sdk', version: '2.0.0')
}

13 changes: 13 additions & 0 deletions android/libs/com/surveymonkey/maven-metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.surveymonkey</groupId>
<artifactId>surveymonkey-android-sdk</artifactId>
<versioning>
<latest>2.0.0</latest>
<release>2.0.0</release>
<versions>
<version>2.0.0</version>
</versions>
<lastUpdated>20220930140521</lastUpdated>
</versioning>
</metadata>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.surveymonkey</groupId>
<artifactId>surveymonkey-android-sdk</artifactId>
<version>2.0.0</version>
<packaging>aar</packaging>
</project>