diff options
| author | Adam Soltys <[email protected]> | 2026-03-05 15:05:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-05 15:51:36 -0800 |
| commit | 4c519faaf748cea25f9d0be87dd0f3e09d7bae4c (patch) | |
| tree | 1fbda1930d8a8f8d6d03871274105dbfb7e1caa8 /android/app/src/main/java/io/coinos/hce/HcePlugin.java | |
| parent | 4a74d51e92365a731a2e5322783b88a39e14f046 (diff) | |
| download | coinos-ui-4c519faaf748cea25f9d0be87dd0f3e09d7bae4c.tar.gz coinos-ui-4c519faaf748cea25f9d0be87dd0f3e09d7bae4c.zip | |
android hce nfc
Diffstat (limited to 'android/app/src/main/java/io/coinos/hce/HcePlugin.java')
| -rw-r--r-- | android/app/src/main/java/io/coinos/hce/HcePlugin.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/android/app/src/main/java/io/coinos/hce/HcePlugin.java b/android/app/src/main/java/io/coinos/hce/HcePlugin.java new file mode 100644 index 00000000..fb562c8d --- /dev/null +++ b/android/app/src/main/java/io/coinos/hce/HcePlugin.java @@ -0,0 +1,29 @@ +package io.coinos.hce; + +import com.getcapacitor.Plugin; +import com.getcapacitor.PluginCall; +import com.getcapacitor.PluginMethod; +import com.getcapacitor.JSObject; +import com.getcapacitor.annotation.CapacitorPlugin; + +@CapacitorPlugin(name = "Hce") +public class HcePlugin extends Plugin { + + @PluginMethod + public void setUrl(PluginCall call) { + String url = call.getString("url"); + if (url == null || url.isEmpty()) { + call.reject("URL is required"); + return; + } + HceApduService.setUrl(url); + call.resolve(); + } + + @PluginMethod + public void getUrl(PluginCall call) { + JSObject result = new JSObject(); + result.put("url", HceApduService.getUrl()); + call.resolve(result); + } +} |
