Alert controller works in browser but not in android

It works fine on my Edge browser except for Android. I tried using Chrome inspect, but no errors were shown. Except it only calls the pre-call in the console and remains stuck at alert.create.

As you may have noticed, it’s straightforward. I don’t know if I still have something to implement for this to work on Android or do I have to disable something for it to work.

Versions
Mobile Chrome Version: 119.0.6045.66
Desktop Edge Version: 120.0.2210.77
Ionic: 7
Android 13

async alertAccountHoldersOnly(){
    console.log("pre call");
    const alert = await this.alert.create({
        header: 'Subscribe Now',
        subHeader: 'short notice',
        message: 'message here',
        buttons: ['Cancel',{
            text: 'OK',
            handler: () => {
                this.router.navigate(['/signin']);
            }
        }]
    });
  
    await alert.present();
    console.log("post call");
}
<ion-button fill="clear" (click)="alertAccountHoldersOnly()">sample</ion-button>

In my case I used standalone mode. Ionic module was not imported and I had to add it manually.
I added following to src/main.ts:

import { enableProdMode, importProvidersFrom } from '@angular/core';
import { IonicModule } from '@ionic/angular';

bootstrapApplication(AppComponent, {
  providers: [
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    importProvidersFrom(IonicModule.forRoot({innerHTMLTemplatesEnabled: true})),  <<=
    provideIonicAngular(),
    provideRouter(routes),
  ],
});
2 Likes