Search in sources :

Example 16 with PluginMethod

use of com.getcapacitor.PluginMethod in project google-maps by capacitor-community.

the class CapacitorGoogleMaps method setMapStyle.

@PluginMethod()
public void setMapStyle(PluginCall call) {
    /*
            https://mapstyle.withgoogle.com/
        */
    final String mapStyle = call.getString("jsonString", "");
    getBridge().executeOnMainThread(new Runnable() {

        @Override
        public void run() {
            MapStyleOptions mapStyleOptions = new MapStyleOptions(mapStyle);
            googleMap.setMapStyle(mapStyleOptions);
        }
    });
}
Also used : MapStyleOptions(com.google.android.libraries.maps.model.MapStyleOptions) PluginMethod(com.getcapacitor.PluginMethod)

Example 17 with PluginMethod

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

the class FilePickerPlugin method pickFiles.

@PluginMethod
public void pickFiles(PluginCall call) {
    JSArray types = call.getArray("types", null);
    boolean multiple = call.getBoolean("multiple", false);
    String[] parsedTypes = parseTypesOption(types);
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("*/*");
    intent.addCategory(Intent.CATEGORY_OPENABLE);
    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple);
    if (multiple == false) {
        if (parsedTypes == null || parsedTypes.length < 1) {
            intent.putExtra(Intent.EXTRA_MIME_TYPES, "*/*");
        } else {
            intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes);
        }
    }
    intent = Intent.createChooser(intent, "Choose a file");
    startActivityForResult(call, intent, "pickFilesResult");
}
Also used : JSArray(com.getcapacitor.JSArray) Intent(android.content.Intent) PluginMethod(com.getcapacitor.PluginMethod)

Example 18 with PluginMethod

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

the class FirebaseAppPlugin method getName.

@PluginMethod
public void getName(PluginCall call) {
    JSObject ret = new JSObject();
    ret.put("name", firebaseAppInstance.getName());
    call.resolve(ret);
}
Also used : JSObject(com.getcapacitor.JSObject) PluginMethod(com.getcapacitor.PluginMethod)

Example 19 with PluginMethod

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

the class FirebaseAuthenticationPlugin method getIdToken.

@PluginMethod
public void getIdToken(PluginCall call) {
    Boolean forceRefresh = call.getBoolean("forceRefresh", false);
    implementation.getIdToken(forceRefresh, new GetIdTokenResultCallback() {

        @Override
        public void success(String token) {
            JSObject result = new JSObject();
            result.put("token", token);
            call.resolve(result);
        }

        @Override
        public void error(String message) {
            call.reject(message);
        }
    });
}
Also used : JSObject(com.getcapacitor.JSObject) PluginMethod(com.getcapacitor.PluginMethod)

Example 20 with PluginMethod

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

the class FirebaseAuthenticationPlugin method getCurrentUser.

@PluginMethod
public void getCurrentUser(PluginCall call) {
    FirebaseUser user = implementation.getCurrentUser();
    JSObject userResult = FirebaseAuthenticationHelper.createUserResult(user);
    JSObject result = new JSObject();
    result.put("user", userResult);
    call.resolve(result);
}
Also used : JSObject(com.getcapacitor.JSObject) FirebaseUser(com.google.firebase.auth.FirebaseUser) 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