How to use the @capacitor/core.Plugins.App function in @capacitor/core

To help you get started, we’ve selected a few @capacitor/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / capacitor / example / src / app / app.component.ts View on Github external
async getLaunchUrl() {
    const ret = await Plugins.App.getLaunchUrl();
    if(ret && ret.url) {
      alert('App opened with URL: ' + ret.url);
    }
    console.log('Launch url: ', ret);
  }
github ionic-team / capacitor / example / src / pages / app / app.ts View on Github external
async canOpenUrl() {
    const ret = await Plugins.App.canOpenUrl({ url: 'com.getcapacitor.myapp' });
    console.log('Can open url: ', ret.value);
  }
github ionic-team / capacitor / example / src / app / app.component.ts View on Github external
constructor(platform: Platform) {
    Plugins.SplashScreen.hide();
    /*
    Plugins.App.addListener('pluginError', (err: any, info: any) => {
      console.error('There was a serious error with a plugin', err, info);
    });
    */

    Plugins.App.addListener('appStateChange', (state: any) => {
      console.log('App state changed', state);
    });

    Plugins.App.addListener('appUrlOpen', (data: any) => {
      alert('APP URL OPEN: ' +  data.url);
    });

    Plugins.App.addListener('appRestoredResult', (data: any) => {
      alert('Got restored result');
      console.log('Restored result:', data);
    });

    this.getLaunchUrl();
  }
github ionic-team / capacitor / example / src / app / app.component.ts View on Github external
Plugins.SplashScreen.hide();
    /*
    Plugins.App.addListener('pluginError', (err: any, info: any) => {
      console.error('There was a serious error with a plugin', err, info);
    });
    */

    Plugins.App.addListener('appStateChange', (state: any) => {
      console.log('App state changed', state);
    });

    Plugins.App.addListener('appUrlOpen', (data: any) => {
      alert('APP URL OPEN: ' +  data.url);
    });

    Plugins.App.addListener('appRestoredResult', (data: any) => {
      alert('Got restored result');
      console.log('Restored result:', data);
    });

    this.getLaunchUrl();
  }