feat(dev): add notification debug panel and native pending inspector
Add a dev-only Notification Debug Panel at /dev/notifications for testing predictive refresh and WAKEUP_PING without a backend. - Gate route and Advanced Settings entry on import.meta.env.DEV - NotificationDebugService drives mock refresh, flood test, clear, and wake simulation via existing handleCapacitorPushNotificationReceived and applyNotificationRefreshPayload (shared with refreshNotifications) - Add NotificationInspector Capacitor plugin: iOS lists pending UNNotificationRequest identifiers and next trigger; Android stub returns empty pending for safe registration
This commit is contained in:
@@ -16,6 +16,7 @@ import android.webkit.WebViewClient;
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
import app.timesafari.safearea.SafeAreaPlugin;
|
||||
import app.timesafari.sharedimage.SharedImagePlugin;
|
||||
import app.timesafari.notifications.NotificationInspectorPlugin;
|
||||
//import com.getcapacitor.community.sqlite.SQLite;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
@@ -66,6 +67,9 @@ public class MainActivity extends BridgeActivity {
|
||||
|
||||
// Register SharedImage plugin
|
||||
registerPlugin(SharedImagePlugin.class);
|
||||
|
||||
// Register NotificationInspector plugin (dev tooling; safe no-op on Android)
|
||||
registerPlugin(NotificationInspectorPlugin.class);
|
||||
|
||||
// Register DailyNotification plugin
|
||||
// Plugin is written in Kotlin but compiles to Java-compatible bytecode
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.timesafari.notifications;
|
||||
|
||||
import com.getcapacitor.JSArray;
|
||||
import com.getcapacitor.JSObject;
|
||||
import com.getcapacitor.Plugin;
|
||||
import com.getcapacitor.PluginCall;
|
||||
import com.getcapacitor.PluginMethod;
|
||||
import com.getcapacitor.annotation.CapacitorPlugin;
|
||||
|
||||
@CapacitorPlugin(name = "NotificationInspector")
|
||||
public class NotificationInspectorPlugin extends Plugin {
|
||||
@PluginMethod
|
||||
public void getPendingNotifications(PluginCall call) {
|
||||
JSObject result = new JSObject();
|
||||
result.put("pending", new JSArray());
|
||||
call.resolve(result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user