diff --git a/android/src/main/java/chat/flyer/rnandroiduripath/RNAndroidURIPathModule.kt b/android/src/main/java/chat/flyer/rnandroiduripath/RNAndroidURIPathModule.kt index af64e02..5fced64 100644 --- a/android/src/main/java/chat/flyer/rnandroiduripath/RNAndroidURIPathModule.kt +++ b/android/src/main/java/chat/flyer/rnandroiduripath/RNAndroidURIPathModule.kt @@ -12,7 +12,7 @@ import java.io.IOException class RNAndroidURIPathModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { - override fun getName() = "RNAndroidURIPath" + override fun getName() = "RNAndroidURIPathModule" @ReactMethod(isBlockingSynchronousMethod = true) fun getPath(uriString: String): String { diff --git a/package.json b/package.json index 480a344..81e4785 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@flyerhq/react-native-android-uri-path", - "version": "1.0.3", + "version": "2.0.1", "description": "Get an absolute path to a file retrieved by Android's Intent.ACTION_GET_CONTENT that returns a content URI.", "homepage": "https://github.com/flyerhq/react-native-android-uri-path#readme", "main": "lib/index.js", diff --git a/src/index.ts b/src/index.ts index 2cd1734..7a9abb3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,8 @@ import { NativeModules, Platform } from 'react-native' const getPath: (uriString: string) => string = - Platform.OS === 'android' - ? NativeModules.RNAndroidURIPath.getPath + Platform.OS === 'android' && NativeModules.RNAndroidURIPathModule + ? NativeModules.RNAndroidURIPathModule.getPath : (uriString: string) => uriString export default getPath