Skip to content
This repository was archived by the owner on Sep 4, 2021. It is now read-only.

Update for RN56+ #83

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,41 @@ geocoding services for react native
## Version table
| Geocoder Version | RN |
| ------- |:----------|
| >=0.6.0 | >= 0.56.0 |
| >=0.5.0 | >= 0.47.0 |
| >=0.4.6 | >= 0.40.0 |
| <0.4.5 | <0.40.0 |
| <0.4.5 | <0.40.0 |



## Install
```
yarn add react-native-geocoder
```
or
```
npm install --save react-native-geocoder
```
## iOS

## Link

### Automatically
Run
```
react-native link react-native-geocoder
```

### Manually
If automatic linking fails you can follow the manual installation steps

#### iOS

1. In the XCode's "Project navigator", right click on Libraries folder under your project ➜ `Add Files to <...>`
2. Go to `node_modules` ➜ `react-native-geocoder` and add `ios/RNGeocoder.xcodeproj` file
3. Add libRNGeocoder.a to "Build Phases" -> "Link Binary With Libraries"

## Android
#### Android

1. In `android/setting.gradle`

```gradle
Expand All @@ -41,7 +59,7 @@ project(':react-native-geocoder').projectDir = new File(rootProject.projectDir,
...
dependencies {
...
compile project(':react-native-geocoder')
implementation project(':react-native-geocoder')
}
```

Expand All @@ -57,7 +75,8 @@ public class MainActivity extends ReactActivity {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNGeocoderPackage()); // <------ add this
new RNGeocoderPackage() // <------ add this
);
}

......
Expand Down
16 changes: 10 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
apply plugin: 'com.android.library'

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

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion safeExtGet('compileSdkVersion', 26)
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 26)
versionCode 1
versionName "1.0"
ndk {
Expand All @@ -16,6 +20,6 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.facebook.react:react-native:+"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
}
4 changes: 2 additions & 2 deletions ios/RNGeocoder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -202,7 +202,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-geocoder",
"version": "0.5.0",
"version": "0.6.0",
"description": "react native geocoding and reverse geocoding",
"main": "index.js",
"scripts": {
Expand All @@ -27,6 +27,9 @@
},
"homepage": "https://github.com/devfd/react-native-geocoder",
"license": "MIT",
"peerDependencies": {
"react-native": ">=0.56.0"
},
"devDependencies": {
"appium": "^1.5.3",
"babel-core": "^6.11.4",
Expand Down
2 changes: 1 addition & 1 deletion react-native-geocoder.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pod::Spec.new do |s|
s.author = { "devfd" => "[email protected]" }
s.license = package["license"]
s.homepage = package["homepage"]
s.platform = :ios, "7.0"
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/devfd/react-native-geocoder.git", :tag => "v#{s.version}" }
s.source_files = 'ios/RNGeocoder/*.{h,m}'
s.preserve_paths = "**/*.js"
Expand Down