From 09a1da57ce386fe9c20c7494c232747fdd828d11 Mon Sep 17 00:00:00 2001 From: Niels Date: Tue, 26 Apr 2016 14:29:40 +0200 Subject: [PATCH] android installation newer react native In newer versions of React Native (0.18+) the MainActivity.java looks different, and you add packages in a different way. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 69efbb2..66caad5 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,25 @@ dependencies { * Register the module (in MainActivity.java) +ReactNative version >= 0.18 +```java +import com.sh3rawi.RNAudioPlayer.*; // <--- import + +public class MainActivity extends ReactActivity { + ... + + @Override + protected List getPackages() { + return Arrays.asList( + new MainReactPackage(), + ... + new RNAudioPlayer() // <--- add here + ); + } +} +``` + +ReactNative version <= 0.17 ```java import com.sh3rawi.RNAudioPlayer.*; // <--- import @@ -57,6 +76,7 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand } ``` + ## Usage ### Usage (iOS)