diff --git a/android/build.gradle b/android/build.gradle index 646c4d5..2434844 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -99,7 +99,7 @@ dependencies { // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin //noinspection GradleDynamicVersion implementation "com.facebook.react:react-android:+" - implementation 'com.github.functionland:fula-build-aar:v1.54.13' // From jitpack.io + implementation 'com.github.functionland:fula-build-aar:v1.54.14' // From jitpack.io implementation 'com.github.functionland:wnfs-android:v1.8.1' // From jitpack.io implementation 'commons-io:commons-io:20030203.000550' implementation 'commons-codec:commons-codec:1.15' diff --git a/android/src/main/java/land/fx/fula/FulaModule.java b/android/src/main/java/land/fx/fula/FulaModule.java index a0b4f56..c35d208 100755 --- a/android/src/main/java/land/fx/fula/FulaModule.java +++ b/android/src/main/java/land/fx/fula/FulaModule.java @@ -1802,4 +1802,34 @@ public void showPluginStatus(String pluginName, int lines, Promise promise) { }); } + @ReactMethod + public void getInstallOutput(String pluginName, String params, Promise promise) { + ThreadUtils.runOnExecutor(() -> { + Log.d("ReactNative", "getInstallOutput: pluginName = " + pluginName + ", params = " + params); + try { + byte[] result = this.fula.getInstallOutput(pluginName, params); + String resultString = toString(result); + promise.resolve(resultString); + } catch (Exception e) { + Log.d("ReactNative", "ERROR:" + e.getMessage()); + promise.reject(e); + } + }); + } + + @ReactMethod + public void getInstallStatus(String pluginName, Promise promise) { + ThreadUtils.runOnExecutor(() -> { + Log.d("ReactNative", "getInstallStatus: pluginName = " + pluginName); + try { + byte[] result = this.fula.getInstallStatus(pluginName); + String resultString = toString(result); + promise.resolve(resultString); + } catch (Exception e) { + Log.d("ReactNative", "ERROR:" + e.getMessage()); + promise.reject(e); + } + }); + } + } diff --git a/example/src/App.tsx b/example/src/App.tsx index 34bdb64..6daba7b 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { StyleSheet, ScrollView, View, Button } from 'react-native'; -import { installPlugin, listPlugins } from '../../src/protocols/fxblox'; +import { installPlugin, listPlugins, getInstallOutput, getInstallStatus } from '../../src/protocols/fxblox'; import { fula, @@ -1164,6 +1164,74 @@ const App = () => { color={inprogress ? 'green' : 'blue'} /> + + +