From 1085d66123734d8d49ec36297ade6c96e108511a Mon Sep 17 00:00:00 2001 From: Andy Prock Date: Mon, 19 Sep 2016 13:03:40 -0700 Subject: [PATCH] update readme with latest linking info --- README.md | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 5188c28..ffd38cd 100644 --- a/README.md +++ b/README.md @@ -16,30 +16,7 @@ npm install --save react-native-tcp ## Link in the native dependency ``` -rnpm link react-native-tcp -``` - -### Android - -* Register and load the Native Module in your Main application -([import](examples/rctsockets/android/app/src/main/java/com/rctsockets/MainApplication.java#L11), [getPackages](examples/rctsockets/android/app/src/main/java/com/rctsockets/MainApplication.java#L28)) - * __Note:__ prior to react-native 0.29.2, this should happen in your Main Activity - -```java -... - -import com.peel.react.TcpSocketsModule; // <--- import // - -public class MainApplication extends Application implements ReactApplication { - ... - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new TcpSocketsModule() // <- add here // - ); - } -} +react-native link react-native-tcp ``` ***Step 3 Profit*** @@ -60,7 +37,7 @@ _only if you want to write require('net') in your javascript_ ### JS -_see/run [index.js](examples/rctsockets) for a complete example, but basically it's just like net_ +_see/run [index.ios.js/index.android.js](examples/rctsockets) for a complete example, but basically it's just like net_ ```js var net = require('net'); @@ -68,17 +45,17 @@ var net = require('net'); // var net = require('react-native-tcp') var server = net.createServer(function(socket) { - socket.write('excellent!'); + socket.write('excellent!'); }).listen(12345); var client = net.createConnection(12345); client.on('error', function(error) { - console.log(error) + console.log(error) }); client.on('data', function(data) { - console.log('message was received', data) + console.log('message was received', data) }); ```