diff --git a/README.md b/README.md index 23e2ef6..68b9e88 100644 --- a/README.md +++ b/README.md @@ -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 @@ -41,7 +59,7 @@ project(':react-native-geocoder').projectDir = new File(rootProject.projectDir, ... dependencies { ... - compile project(':react-native-geocoder') + implementation project(':react-native-geocoder') } ``` @@ -57,7 +75,8 @@ public class MainActivity extends ReactActivity { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new RNGeocoderPackage()); // <------ add this + new RNGeocoderPackage() // <------ add this + ); } ...... diff --git a/android/build.gradle b/android/build.gradle index 8a174dc..3473da7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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 { @@ -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', '+')}" } diff --git a/ios/RNGeocoder.xcodeproj/project.pbxproj b/ios/RNGeocoder.xcodeproj/project.pbxproj index 4ad38e0..b66bf22 100644 --- a/ios/RNGeocoder.xcodeproj/project.pbxproj +++ b/ios/RNGeocoder.xcodeproj/project.pbxproj @@ -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; @@ -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; diff --git a/package.json b/package.json index 22e016b..ae736e1 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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", diff --git a/react-native-geocoder.podspec b/react-native-geocoder.podspec index 8235f87..2145c4a 100644 --- a/react-native-geocoder.podspec +++ b/react-native-geocoder.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.author = { "devfd" => "hello@devfd.me" } 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"