Search in sources :

Example 21 with PluginMethod

use of com.getcapacitor.PluginMethod 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 22 with PluginMethod

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

the class FirebasePerformancePlugin method stopTrace.

@PluginMethod
public void stopTrace(PluginCall call) {
    String traceName = call.getString("traceName");
    if (traceName == null) {
        call.reject(ERROR_TRACE_NAME_MISSING);
        return;
    }
    Trace trace = implementation.getTraceByName(traceName);
    if (trace == null) {
        call.reject(ERROR_TRACE_NOT_FOUND);
        return;
    }
    implementation.stopTrace(traceName);
    call.resolve();
}
Also used : Trace(com.google.firebase.perf.metrics.Trace) PluginMethod(com.getcapacitor.PluginMethod)

Example 23 with PluginMethod

use of com.getcapacitor.PluginMethod 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 24 with PluginMethod

use of com.getcapacitor.PluginMethod 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 25 with PluginMethod

use of com.getcapacitor.PluginMethod 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

PluginMethod (com.getcapacitor.PluginMethod)120 JSObject (com.getcapacitor.JSObject)93 JSONException (org.json.JSONException)18 MyRunnable (com.jeep.plugin.capacitor.capacitorvideoplayer.Notifications.MyRunnable)13 JSONObject (org.json.JSONObject)13 JSArray (com.getcapacitor.JSArray)12 Radar (io.radar.sdk.Radar)11 Location (android.location.Location)8 Intent (android.content.Intent)7 NotNull (org.jetbrains.annotations.NotNull)6 Nullable (org.jetbrains.annotations.Nullable)6 Uri (android.net.Uri)5 LatLng (com.google.android.libraries.maps.model.LatLng)5 GenericAd (admob.plus.core.GenericAd)4 GoogleSignInAccount (com.google.android.gms.auth.api.signin.GoogleSignInAccount)4 Gson (com.google.gson.Gson)4 PackageManager (android.content.pm.PackageManager)3 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)3 User (io.ionic.demo.ecommerce.data.model.User)3 Context (android.content.Context)2