Skip to content

Commit

Permalink
feat(core): account manager library v1
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Oct 22, 2018
1 parent 9184536 commit 5ae07b1
Show file tree
Hide file tree
Showing 23 changed files with 780 additions and 781 deletions.
2 changes: 1 addition & 1 deletion build/docker/protoc/Dockerfile
Expand Up @@ -13,7 +13,7 @@ RUN go get -u -v \
moul.io/protoc-gen-gotemplate \
golang.org/x/tools/cmd/goimports \
github.com/99designs/gqlgen \
github.com/vektah/gorunpkg \
github.com/99designs/gorunpkg \
github.com/spf13/cobra

RUN cd /go/src/github.com/99designs/gqlgen && git checkout v0.6.0 && go install github.com/99designs/gqlgen
Expand Down
@@ -1,2 +1,2 @@
#Wed Oct 10 17:02:13 CEST 2018
#Fri Oct 19 17:39:17 CEST 2018
connection.project.dir=
2 changes: 1 addition & 1 deletion client/react-native/android/app/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
@@ -1,2 +1,2 @@
#Wed Oct 10 17:02:14 CEST 2018
#Fri Oct 19 17:39:18 CEST 2018
connection.project.dir=..
6 changes: 3 additions & 3 deletions client/react-native/android/app/build.gradle
Expand Up @@ -141,9 +141,9 @@ android {
}

dependencies {
compile project(':react-native-vector-icons')
compile project(':react-native-network-info')
compile project(':react-native-image-picker')
api project(':react-native-vector-icons')
api project(':react-native-network-info')
api project(':react-native-image-picker')
implementation fileTree(dir: "libs", include: ["*.jar", "core.aar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
Expand Down
@@ -1,5 +1,7 @@
package chat.berty.core;

import android.util.Log;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.Promise;
Expand Down Expand Up @@ -34,12 +36,12 @@ public void start(Promise promise) throws Exception {
}

@ReactMethod
public void getPort(Promise promise) {
public void getPort(Promise promise) throws Exception {
try {
Long port = Core.getPort();
promise.resolve(port.toString());
Long data = Core.getPort();
promise.resolve(data.toString());
} catch (Exception err) {
this.logger.format(Level.ERROR, this.getName(), "Unable to get port", err);
this.logger.format(Level.ERROR, this.getName(), "Unable to get port :%s", err);
promise.reject(err);
}
}
Expand Down
1 change: 1 addition & 0 deletions client/react-native/android/settings.gradle
@@ -1,4 +1,5 @@
rootProject.name = 'Berty'

include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-network-info'
Expand Down
15 changes: 9 additions & 6 deletions client/react-native/common/relay/environment.js
Expand Up @@ -3,7 +3,10 @@ import { SubscriptionClient } from 'subscriptions-transport-ws'
import { Platform, NativeModules } from 'react-native'
import { installRelayDevTools } from 'relay-devtools'

installRelayDevTools()
// eslint-disable-next-line
if (__DEV__) {
installRelayDevTools()
}

// @TODO: patch web CoreModule
if (Platform.OS === 'web') {
Expand Down Expand Up @@ -45,15 +48,15 @@ let getIP = () =>
if (Platform.OS === 'web') {
return resolve(window.location.hostname)
}

if (__DEV__) { // eslint-disable-line
return require('react-native-network-info').NetworkInfo.getIPV4Address(ip => resolve(ip))
// eslint-disable-next-line
if (__DEV__) {
return require('react-native-network-info').NetworkInfo.getIPV4Address(
ip => resolve(ip)
)
}

if (Platform.OS === 'ios') {
return resolve('127.0.0.1')
}

if (Platform.OS === 'android') {
return resolve('10.0.2.2')
}
Expand Down

0 comments on commit 5ae07b1

Please sign in to comment.