Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
frddl authored Mar 28, 2018
1 parent 0910720 commit 77beb1b
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,54 @@
# NetworkProvider
Ionic 3 Provider that detects the network change in application and notifies the user with an alert.
# Network Provider

Network Provider is an Ionic3-based provider that detects the network change in application and notifies the user with an alert.

- Import the provider in app.module and app.component
- Call the .networkDetect() function in app.component constructor
- See the magic!

---
### Installation

*app.module.ts*

```ts
import { Network } from '@ionic-native/network';
import { NetworkProvider } from '../providers/network/network';

@NgModule({
...
providers: [
...
Network,
NetworkProvider,
],
})
```

*app.component.ts*

```ts
import { NetworkProvider } from '../providers/network/network';

@Component({
templateUrl: "app.html"
})
class MyApp {
constructor(network: NetworkProvider) {
...
network.detectNetwork();
....
}
...
}
```

### Todos

- Add Network Detection on first run of the application
- Add screenshots to README

License
----

MIT

0 comments on commit 77beb1b

Please sign in to comment.