Send app state changes to status-go.
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
parent
48dd386051
commit
3008e38624
|
@ -17,7 +17,7 @@ dependencies {
|
|||
implementation 'com.github.ericwlange:AndroidJSCore:3.0.1'
|
||||
implementation 'status-im:function:0.0.1'
|
||||
|
||||
String statusGoVersion = 'develop-gaabbcbe5'
|
||||
String statusGoVersion = 'develop-g3b92b61e'
|
||||
final String statusGoGroup = 'status-im', statusGoName = 'status-go'
|
||||
|
||||
// Check if the local status-go jar exists, and compile against that if it does
|
||||
|
|
|
@ -705,4 +705,10 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||
Log.d(TAG, "ConnectionChange: " + type + ", is expensive " + isExpensive);
|
||||
Statusgo.ConnectionChange(type, isExpensive ? 1 : 0);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void appStateChange(final String type) {
|
||||
Log.d(TAG, "AppStateChange: " + type);
|
||||
Statusgo.AppStateChange(type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -412,6 +412,13 @@ RCT_EXPORT_METHOD(connectionChange:(NSString *)type
|
|||
ConnectionChange((char *) [type UTF8String], isExpensive? 1 : 0);
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(appStateChange:(NSString *)type) {
|
||||
#if DEBUG
|
||||
NSLog(@"AppStateChange() method called");
|
||||
#endif
|
||||
AppStateChange((char *) [type UTF8String]);
|
||||
}
|
||||
|
||||
+ (void)signalEvent:(const char *) signal
|
||||
{
|
||||
if(!signal){
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<artifactItem>
|
||||
<groupId>status-im</groupId>
|
||||
<artifactId>status-go-ios-simulator</artifactId>
|
||||
<version>develop-gaabbcbe5</version>
|
||||
<version>develop-g3b92b61e</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>./</outputDirectory>
|
||||
|
|
|
@ -95,3 +95,6 @@
|
|||
|
||||
(defn connection-change [data]
|
||||
(module-interface/-connection-change rns-module data))
|
||||
|
||||
(defn app-state-change [state]
|
||||
(module-interface/-app-state-change rns-module state))
|
||||
|
|
|
@ -236,6 +236,9 @@
|
|||
(defn connection-change [{:keys [type expensive?]}]
|
||||
(.connectionChange status type expensive?))
|
||||
|
||||
(defn app-state-change [state]
|
||||
(.appStateChange status state))
|
||||
|
||||
(defrecord ReactNativeStatus []
|
||||
module/IReactNativeStatus
|
||||
;; status-go calls
|
||||
|
@ -282,4 +285,6 @@
|
|||
(-close-application [this]
|
||||
(close-application))
|
||||
(-connection-change [this data]
|
||||
(connection-change data)))
|
||||
(connection-change data))
|
||||
(-app-state-change [this state]
|
||||
(app-state-change state)))
|
||||
|
|
|
@ -61,4 +61,5 @@
|
|||
(-notify-users [this {:keys [message payload tokens] :as m} callback])
|
||||
(-add-peer [this enode callback])
|
||||
(-close-application [this])
|
||||
(-connection-change [this data]))
|
||||
(-connection-change [this data])
|
||||
(-app-state-change [this state]))
|
||||
|
|
|
@ -21,5 +21,6 @@
|
|||
(-notify-users [this {:keys [message payload tokens] :as m} callback])
|
||||
(-add-peer [this enode callback])
|
||||
(-close-application [this])
|
||||
(-connection-change [this data]))
|
||||
(-connection-change [this data])
|
||||
(-app-state-change [this state]))
|
||||
|
||||
|
|
|
@ -393,9 +393,8 @@
|
|||
|
||||
(handlers/register-handler-fx
|
||||
:app-state-change
|
||||
(fn [_ [_ state]]))
|
||||
;; TODO(rasom): let's not remove this handler, it will be used for
|
||||
;; pausing node on entering background on android
|
||||
(fn [_ [_ state]]
|
||||
(status/app-state-change state)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:request-permissions
|
||||
|
|
Loading…
Reference in New Issue