Search in sources :

Example 31 with JSObject

use of com.getcapacitor.JSObject in project capacitor-firebase by robingenz.

the class FirebasePerformancePlugin method isPerformanceCollectionEnabled.

@PluginMethod
public void isPerformanceCollectionEnabled(PluginCall call) {
    Boolean enabled = implementation.isPerformanceCollectionEnabled();
    JSObject result = new JSObject();
    result.put("enabled", enabled);
    call.resolve(result);
}
Also used : JSObject(com.getcapacitor.JSObject) PluginMethod(com.getcapacitor.PluginMethod)

Example 32 with JSObject

use of com.getcapacitor.JSObject in project capacitor-firebase by robingenz.

the class FirebaseAnalyticsPlugin method logEvent.

@PluginMethod
public void logEvent(PluginCall call) {
    String name = call.getString("name");
    if (name == null) {
        call.reject(ERROR_NAME_MISSING);
        return;
    }
    JSObject params = call.getObject("params");
    implementation.logEvent(name, params);
    call.resolve();
}
Also used : JSObject(com.getcapacitor.JSObject) PluginMethod(com.getcapacitor.PluginMethod)

Example 33 with JSObject

use of com.getcapacitor.JSObject in project capacitor-jitsi-meet by calvinckho.

the class Jitsi method leaveConference.

@PluginMethod()
public void leaveConference(PluginCall call) {
    Intent leaveBroadcastIntent = BroadcastIntentHelper.buildHangUpIntent();
    LocalBroadcastManager.getInstance(getContext()).sendBroadcast(leaveBroadcastIntent);
    JSObject ret = new JSObject();
    ret.put("success", true);
    call.resolve(ret);
}
Also used : JSObject(com.getcapacitor.JSObject) Intent(android.content.Intent) PluginMethod(com.getcapacitor.PluginMethod)

Example 34 with JSObject

use of com.getcapacitor.JSObject in project capacitor-updater by Cap-go.

the class CapacitorUpdaterPlugin method notifyDownload.

public void notifyDownload(int percent) {
    JSObject ret = new JSObject();
    ret.put("percent", percent);
    notifyListeners("download", ret);
}
Also used : JSObject(com.getcapacitor.JSObject)

Example 35 with JSObject

use of com.getcapacitor.JSObject in project capacitor-updater by Cap-go.

the class CapacitorUpdaterPlugin method list.

@PluginMethod
public void list(PluginCall call) {
    ArrayList<String> res = implementation.list();
    JSObject ret = new JSObject();
    ret.put("versions", new JSArray(res));
    call.resolve(ret);
}
Also used : JSArray(com.getcapacitor.JSArray) JSObject(com.getcapacitor.JSObject) PluginMethod(com.getcapacitor.PluginMethod)

Aggregations

JSObject (com.getcapacitor.JSObject)169 PluginMethod (com.getcapacitor.PluginMethod)93 JSONException (org.json.JSONException)28 JSONObject (org.json.JSONObject)20 MyRunnable (com.jeep.plugin.capacitor.capacitorvideoplayer.Notifications.MyRunnable)16 JSArray (com.getcapacitor.JSArray)14 Radar (io.radar.sdk.Radar)12 Uri (android.net.Uri)11 Location (android.location.Location)9 JSONArray (org.json.JSONArray)7 ArrayList (java.util.ArrayList)6 NotNull (org.jetbrains.annotations.NotNull)6 Nullable (org.jetbrains.annotations.Nullable)6 ParseException (java.text.ParseException)5 Intent (android.content.Intent)4 FirebaseUser (com.google.firebase.auth.FirebaseUser)4 Gson (com.google.gson.Gson)4 Date (java.util.Date)4 HashMap (java.util.HashMap)4 Test (org.junit.Test)4