Skip to content

Instantly share code, notes, and snippets.

@takuya-nakayasu
Created September 7, 2019 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuya-nakayasu/09ef19ef41a34b4ce51db1b8f6b5bd70 to your computer and use it in GitHub Desktop.
Save takuya-nakayasu/09ef19ef41a34b4ce51db1b8f6b5bd70 to your computer and use it in GitHub Desktop.
Custom URL Schemeのルーティング設定
// ...省略
import { Deeplinks } from '@ionic-native/deeplinks';
@Component({
templateUrl: 'app.component.html'
})
export class AppComponent {
constructor(platform: Platform,
// ...省略
private deeplinks: Deeplinks,
private httpService: HttpService) {
platform.ready().then(() => {
// WebサイトでCustom URL Schemeをタップした時のルーティング設定
this.deeplinks.route({
// AppComponentに遷移する
'/home': AppComponent
}).subscribe((match) => {
console.log('Success', match);
}, (nomatch) => {
console.log('Error', nomatch);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment