Browse Source
- Move plugin registration before super.onCreate() in MainActivity - Create dedicated dailynotification module for proper plugin structure - Add comprehensive logging for plugin registration debugging - Update Vue components with enhanced plugin detection and logging - Fix TypeScript errors in HomeView.vue for proper build The plugin was not being loaded because registration happened after BridgeActivity initialization. Moving registerPlugin() before super.onCreate() ensures the plugin is available when Capacitor loads plugins. Resolves simplified status dialog issue by ensuring native plugin is properly registered and accessible to JavaScript layer.master
8 changed files with 236 additions and 51 deletions
@ -1,5 +1,24 @@ |
|||
package com.timesafari.dailynotification.test; |
|||
|
|||
import com.getcapacitor.BridgeActivity; |
|||
import com.timesafari.dailynotification.DailyNotificationPlugin; |
|||
|
|||
public class MainActivity extends BridgeActivity {} |
|||
public class MainActivity extends BridgeActivity { |
|||
@Override |
|||
public void onCreate(android.os.Bundle savedInstanceState) { |
|||
android.util.Log.d("MainActivity", "MainActivity.onCreate() called - START"); |
|||
|
|||
// Register the DailyNotification plugin BEFORE calling super.onCreate()
|
|||
android.util.Log.d("MainActivity", "Registering DailyNotification plugin..."); |
|||
try { |
|||
registerPlugin(DailyNotificationPlugin.class); |
|||
android.util.Log.d("MainActivity", "DailyNotification plugin registered successfully"); |
|||
} catch (Exception e) { |
|||
android.util.Log.e("MainActivity", "Failed to register DailyNotification plugin", e); |
|||
} |
|||
|
|||
super.onCreate(savedInstanceState); |
|||
android.util.Log.d("MainActivity", "MainActivity.onCreate() - after super.onCreate()"); |
|||
android.util.Log.d("MainActivity", "MainActivity.onCreate() called - END"); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
apply plugin: 'com.android.library' |
|||
|
|||
android { |
|||
namespace "com.timesafari.dailynotification" |
|||
compileSdkVersion rootProject.ext.compileSdkVersion |
|||
|
|||
defaultConfig { |
|||
minSdkVersion rootProject.ext.minSdkVersion |
|||
targetSdkVersion rootProject.ext.targetSdkVersion |
|||
versionCode 1 |
|||
versionName "1.0" |
|||
} |
|||
|
|||
compileOptions { |
|||
sourceCompatibility JavaVersion.VERSION_17 |
|||
targetCompatibility JavaVersion.VERSION_17 |
|||
} |
|||
} |
|||
|
|||
dependencies { |
|||
implementation project(':capacitor-android') |
|||
} |
@ -0,0 +1,6 @@ |
|||
[ |
|||
{ |
|||
"name": "DailyNotification", |
|||
"classpath": "com.timesafari.dailynotification.DailyNotificationPlugin" |
|||
} |
|||
] |
@ -1,4 +1,5 @@ |
|||
include ':app' |
|||
include ':dailynotification' |
|||
include ':capacitor-cordova-android-plugins' |
|||
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/') |
|||
|
|||
|
Loading…
Reference in new issue