0
I’m trying to handle redirect URLs from an external service (a Laravel backend) into my Ionic app, but I’m running into issues.
Context:
External URL Example: https://my-laravel-website.com/api/get-tap?tap_id=23 Goal: When the URL is opened, I want my Ionic app to handle it, extract the necessary information, and close any open browser windows.
My Code:
AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="my-laravel-website.com" />
</intent-filter>
Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>https</string>
</array>
<key>CFBundleURLName</key>
<string>my-laravel-website.com</string>
</dict>
</array>
my-component.ts
import { Component } from '@angular/core';
import { App } from '@capacitor/app';
constructor() {
this.initializeApp();
}
initializeApp() {
App.addListener('appUrlOpen', (data: any) => {
console.log('App opened with URL:', data.url);
});
}
Issue:
The appUrlOpen event is not being triggered when the URL is opened
I am testing the app with Android Studio on my real device
Any guidance or suggestions would be greatly appreciated! Thank you!