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);
}
});
}
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");
}
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);
}
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);
}
});
}
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);
}
Aggregations