In my app so far all the window.open calls work fine on iOS but this one is using an async function.
Is there a solution for this?
I have spent several hours trying various things from stackoverflow.
I have seen that installing the inAppBrowser may help which I have not tried yet.
I also saw that putting the window.open in the click event may allow it but this would require the user to make another click which is not ideal.
<ion-button type="button" color="primary" expand="block" (click)="onCreateStripePortalSession()">
Manage my cards
</ion-button>
async onCreateStripePortalSession() {
const returnUrl = `https://myapp.app/goto/${this.tenant.slug}/account`;
try {
const session = await this.stripeService.createStripePortalSession(this.member.stripeCustomerId, returnUrl);
if (session.url) {
// Go to Stripe Customer Portal
window.open(session.url, '_blank');
}
} catch (err) {
console.log(err);
}
}
1 post - 1 participant