cordova-plugin-drawoverapps
cordova-plugin-drawoverapps copied to clipboard
Doesn't install with cordova-android 12.0.0
Description:
I'm facing an issue with the cordova-plugin-drawoverapps plugin in my Ionic project. The overApps object seems to be undefined, and I'm unable to access its functions.
Steps to Reproduce:
Create a new Ionic project. Install the cordova-plugin-drawoverapps plugin using cordova plugin add cordova-plugin-drawoverapps (it did not install directly either so I tried a couple of step to get it working and updated the deprecated WebView functions) Attempt to access the overApps object and its functions. Expected Behavior:
The overApps object should be available, and I should be able to use its functions like startOverApp().
Actual Behavior:
The overApps object is undefined even after waiting for the platform.ready event. As a result, I'm unable to use any functions provided by the plugin.
Environment:
Ionic CLI version: 6.20.8 Cordova version: 12.0.0 ([email protected]) Platform(s): Android Additional Information:
I've verified that the cordova-plugin-drawoverapps plugin is correctly installed in the project, and it's listed in the config.xml. I've tried reinstalling the plugin and creating a new project, but the issue persists.
Code Sample:
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
declare var window: any;
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss']
})
export class AppComponent {
constructor(private platform: Platform) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.setupOverApps();
});
}
setupOverApps() {
// Now you can use the overApps object here.
if (overApps) {
console.log('overApps object is available.');
// Call window.overApps.startOverApp() and other functions here.
} else {
console.log('overApps object is not available.');
}
}
}
Please let me know if you need any further information or if there's anything else I can provide to help resolve this issue.