feat(android): implement plugin diagnostics and fix Vue 3 compatibility
- Add runPluginDiagnostics and openConsole methods to HomeView.vue - Convert ActionCard.vue from vue-facing-decorator to Composition API - Enhance App.vue with improved plugin detection and error handling - Add simplified DailyNotificationPlugin.java with basic methods - Fix plugin registration in capacitor.plugins.json - Remove error dialogs, rely on console logging for diagnostics The Plugin Diagnostics button now provides detailed platform and plugin status information.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.timesafari.dailynotification.test;
|
||||
|
||||
import com.getcapacitor.JSObject;
|
||||
import com.getcapacitor.Plugin;
|
||||
import com.getcapacitor.PluginCall;
|
||||
import com.getcapacitor.PluginMethod;
|
||||
import com.getcapacitor.annotation.CapacitorPlugin;
|
||||
|
||||
@CapacitorPlugin(name = "DailyNotification")
|
||||
public class DailyNotificationPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
super.load();
|
||||
// Log that the plugin has loaded
|
||||
System.out.println("DN|PLUGIN_LOAD_START");
|
||||
}
|
||||
|
||||
@PluginMethod
|
||||
public void echo(PluginCall call) {
|
||||
String value = call.getString("value");
|
||||
JSObject ret = new JSObject();
|
||||
ret.put("value", value);
|
||||
call.resolve(ret);
|
||||
}
|
||||
|
||||
@PluginMethod
|
||||
public void checkStatus(PluginCall call) {
|
||||
JSObject ret = new JSObject();
|
||||
ret.put("status", "OK from native plugin");
|
||||
call.resolve(ret);
|
||||
}
|
||||
|
||||
@PluginMethod
|
||||
public void scheduleNotification(PluginCall call) {
|
||||
String title = call.getString("title");
|
||||
String message = call.getString("message");
|
||||
JSObject ret = new JSObject();
|
||||
ret.put("scheduleResult", "Notification '" + title + "' scheduled with message '" + message + "'");
|
||||
call.resolve(ret);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user