use of com.getcapacitor.JSObject in project capacitor-music-controls-plugin-new by gokadzev.
the class CapacitorMusicControls method updateMetadata.
@PluginMethod()
public void updateMetadata(PluginCall call) {
JSObject options = call.getData();
this.updateMetadata(options);
call.resolve();
}
use of com.getcapacitor.JSObject in project capacitor-music-controls-plugin-new by gokadzev.
the class MediaSessionCallback method onSkipToPrevious.
@Override
public void onSkipToPrevious() {
super.onSkipToPrevious();
JSObject ret = new JSObject();
ret.put("message", "music-controls-media-button-previous");
this.musicControls.controlsNotification(ret);
// if(this.cb != null) {
// this.cb.success("{\"message\": \"music-controls-media-button-previous\"}");
// this.cb = null;
// }
}
use of com.getcapacitor.JSObject in project capacitor-music-controls-plugin-new by gokadzev.
the class MediaSessionCallback method onPause.
@Override
public void onPause() {
super.onPause();
JSObject ret = new JSObject();
ret.put("message", "music-controls-media-button-pause");
this.musicControls.controlsNotification(ret);
// if(this.cb != null) {
// this.cb.success("{\"message\": \"music-controls-media-button-pause\"}");
// this.cb = null;
// }
}
use of com.getcapacitor.JSObject in project portals-ecommerce-demo by ionic-team.
the class ShopAPIPluginTest method getCartShouldReturnCart.
@Test
public void getCartShouldReturnCart() {
ShopAPIPlugin plugin = new ShopAPIPlugin();
plugin.getCart(call);
ArgumentCaptor<JSObject> argument = ArgumentCaptor.forClass(JSObject.class);
verify(call).resolve(argument.capture());
assertEquals("1", argument.getValue().getString("id"));
}
use of com.getcapacitor.JSObject in project portals-ecommerce-demo by ionic-team.
the class ShopAPIPlugin method getUserDetails.
@PluginMethod
public void getUserDetails(PluginCall call) {
try {
User user = dataService.getUser();
String userJson = new Gson().toJson(user);
JSObject userJSObject = JSObject.fromJSONObject(new JSONObject(userJson));
call.resolve(userJSObject);
} catch (JSONException e) {
call.reject("error decoding user object");
}
}
Aggregations