0
votes

Error on ionic deeplinking ,

Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at Deeplinks.route (http://localhost:8100/build/vendor.js:94242:126)

Code:

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();



  this.deeplinks.route({
      '/': {},
      '/reset-password/:Id': MmresetpasswordPage
    })
    .subscribe(match => {
      alert(JSON.stringify(match));
    }, nomatch => {
      alert(JSON.stringify(nomatch));

    });

});
1
you need to set public/private to your object in constructor. - CodeChanger
CodeChanger: give me an example? - user9264919
Same error I am facing in version ionic 3 and angular 5. Please suggest a solution - Mukesh Kushwah

1 Answers

1
votes

Install the v5 of deeplinks: npm i -s @ionic-native/deeplinks@5

Import in components and modules like: import {Deeplinks} from '@ionic-native/deeplinks/ngx' (note /ngx at end)

Then declare in component.ts like: constructor(private deeplinks:Deeplinks){}

Then Provide in app.module.ts like: providers:[Deeplinks]