Skip to content

yc-ionic/custom-url-scheme

Repository files navigation

Build Status Coverage Status MIT license

@yci/custom-url-scheme

Installation

  1. Install the Ionic plugin
 npm i -S @yci/custom-url-scheme
  1. Install the cordova plugin written by EddyVerbruggen

https://github.com/EddyVerbruggen/Custom-URL-scheme

  1. Add it to your app’s NgModule.
// Import your library
import { CustomUrlSchemeModule } from '@yci/custom-url-scheme';

@NgModule({

  ...

  imports: [

    ...

    // Specify your library as an import
    CustomUrlSchemeModule.forRoot()
  ],
  
  ...

})
export class AppModule { }

Usage

Once your library is imported, you can use its service in your Angular application:

import { CustomUrlScheme } from '@yci/custom-url-scheme';

// ...

constructor(public cus: CustomUrlScheme) {
  cus.add('myScheme')
    .subscribe(x => {
      console.log(x);
    });
}

// ...

Methods

public add(urlScheme: string): Subject<IUrlScheme>;

Interfaces

interface IUrlScheme {
  scheme: string;
  path: string;
  query: {
    [x: string]: string;
  };
}

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

License

MIT © Yu Chen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published