123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- package com.example.nexilissamplecodeionic;
- import com.getcapacitor.JSObject;
- import com.getcapacitor.Plugin;
- import com.getcapacitor.PluginCall;
- import com.getcapacitor.PluginMethod;
- import com.getcapacitor.annotation.CapacitorPlugin;
- import io.nexilis.service.API;
- @CapacitorPlugin(name = "NativeCap")
- public class NativePlugin extends Plugin {
- @PluginMethod
- public void openContactCenter(PluginCall call) {
- String response = API.openContactCenter();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openChat(PluginCall call) {
- String response = API.openChat();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openCall(PluginCall call) {
- String response = API.openCall();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openStreaming(PluginCall call) {
- String response = API.openLiveStreaming();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openChatGPT(PluginCall call) {
- String response = API.openSmartChatbot();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openSetOfficer(PluginCall call) {
- String response = API.openSetAsOfficerForm();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openSettings(PluginCall call) {
- API.openSettings();
- }
- @PluginMethod
- public void openProfile(PluginCall call) {
- API.openProfile();
- }
- @PluginMethod
- public void openContactCenterChat(PluginCall call) {
- int category = call.getInt("category", 0);
- String response = API.openContactCenter(0, category);
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openContactCenterAudioCall(PluginCall call) {
- int category = call.getInt("category", 0);
- String response = API.openContactCenter(1, category);
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openContactCenterVideoCall(PluginCall call) {
- int category = call.getInt("category", 0);
- String response = API.openContactCenter(2, category);
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void adminSignIn(PluginCall call) {
- if (!call.getData().has("pwd")) {
- call.reject("Must provide an pwd");
- return;
- }
- String pwd = call.getString("pwd");
- String response = API.signInAdmin(pwd);
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openWhiteboard(PluginCall call) {
- String response = API.openWhiteboard();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openSecureFolder(PluginCall call) {
- String response = API.openSecureFolder();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- @PluginMethod
- public void openNotificationCenter(PluginCall call) {
- String response = API.openNotificationCenter();
- JSObject ret = new JSObject();
- ret.put("response", response);
- call.resolve(ret);
- }
- }
|