Created
September 7, 2019 09:26
-
-
Save takuya-nakayasu/09ef19ef41a34b4ce51db1b8f6b5bd70 to your computer and use it in GitHub Desktop.
Custom URL Schemeのルーティング設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ...省略 | |
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