Bonjour la communauté!
J’ai une application avec un lien un profond, dont le fichier config.xml est la suivante:
<plugin name="ionic-plugin-deeplinks" spec="1.0.17">
<variable name="URL_SCHEME" value="aefinfo" />
<variable name="DEEPLINK_SCHEME" value="https" />
<variable name="DEEPLINK_HOST" value="www.aefinfo.fr" />
<variable name="ANDROID_PATH_PREFIX" value="C:/Program Files/Git/" />
</plugin>
et le app.components.ts est la suivante:
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { Deeplinks } from '@ionic-native/deeplinks';
import { HomePage } from '../pages/home/home';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage: any = HomePage;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, private deeplinks: Deeplinks) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
//initialisation de deeplink
this.deeplinks.route({
'/': {},
'/depeche': { "depeche": true }
}).subscribe((match) => {
alert(JSON.stringify(match));
/* let idDepeche = JSON.stringify(match.$args.id);
let id = idDepeche.replace('"', '');
let id1 = id.replace('"', '');
this.appCtrl.getRootNav().push(DepechePage, {
id: id1
});*/
}, nomatch => {
alert(Number("597887"));
});
});
}
}
j’ai crée ses 2 liens sur codepen:
<h1><a href="aefinfo://www.aefinfo.fr/depeche/?id=598007">lien vers AEF</a></h1>
<h1><a href="https://www.aefinfo.fr/depeche/?id=598007">lien interne vers AEF</a></h1>
Alors quand je clique sur le premier lien:
, il détecte et m’ouvre bien application, tout marche. Maintenant ce que je voudrais c’est de pouvoir cliquer sur le deuxième lien:
et qu’il m’ouvre aussi l’application.
Merci pour votre aide