123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- package com.nxsample;
- import androidx.annotation.NonNull;
- import com.facebook.react.bridge.Promise;
- import com.facebook.react.bridge.ReactApplicationContext;
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
- import com.facebook.react.bridge.ReactMethod;
- import io.nexilis.ui.API;
- public class CallNative extends ReactContextBaseJavaModule {
- CallNative(ReactApplicationContext context) {
- super(context);
- }
- @NonNull
- @Override
- public String getName() {
- return "CallNative";
- }
- @ReactMethod
- public void openContactCenter(Promise promise) {
- String response = API.openContactCenter();
- promise.resolve(response);
- }
- @ReactMethod
- public void openChat(Promise promise) {
- String response = API.openChat();
- promise.resolve(response);
- }
- @ReactMethod
- public void openCall(Promise promise) {
- String response = API.openCall();
- promise.resolve(response);
- }
- @ReactMethod
- public void openStreaming(Promise promise) {
- String response = API.openLiveStreaming();
- promise.resolve(response);
- }
- @ReactMethod
- public void openSetting() {
- API.openSettings();
- }
- @ReactMethod
- public void openProfile() {
- API.openProfile();
- }
- @ReactMethod
- public void openWhiteboard(Promise promise) {
- String response = API.openWhiteboard();
- promise.resolve(response);
- }
- @ReactMethod
- public void openChatGPT(Promise promise) {
- String response = API.openSmartChatbot();
- promise.resolve(response);
- }
- @ReactMethod
- public void openContactCenterChat(int category, Promise promise) {
- String response = API.openContactCenter(0, category);
- promise.resolve(response);
- }
- @ReactMethod
- public void openContactCenterAudioCall(int category, Promise promise) {
- String response = API.openContactCenter(1, category);
- promise.resolve(response);
- }
- @ReactMethod
- public void openContactCenterVideoCall(int category, Promise promise) {
- String response = API.openContactCenter(2, category);
- promise.resolve(response);
- }
- @ReactMethod
- public void signInAdmin(String pwd, Promise promise) {
- if(pwd.trim().isEmpty()) {
- promise.reject("signInAdmin error", "pwd is null");
- return;
- }
- String response = API.signInAdmin(pwd);
- promise.resolve(response);
- }
- @ReactMethod
- public void openSetOfficer(Promise promise) {
- String response = API.openSetAsOfficerForm();
- promise.resolve(response);
- }
- @ReactMethod
- public void openSecureFolder(Promise promise) {
- String response = API.openSecureFolder();
- promise.resolve(response);
- }
- @ReactMethod
- public void openNotificationCenter(Promise promise) {
- String response = API.openNotificationCenter();
- promise.resolve(response);
- }
- }
|