Skip to content

Commit 77beb1b

Browse files
authored
Update README.md
1 parent 0910720 commit 77beb1b

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
1-
# NetworkProvider
2-
Ionic 3 Provider that detects the network change in application and notifies the user with an alert.
1+
# Network Provider
2+
3+
Network Provider is an Ionic3-based provider that detects the network change in application and notifies the user with an alert.
4+
5+
- Import the provider in app.module and app.component
6+
- Call the .networkDetect() function in app.component constructor
7+
- See the magic!
8+
9+
---
10+
### Installation
11+
12+
*app.module.ts*
13+
14+
```ts
15+
import { Network } from '@ionic-native/network';
16+
import { NetworkProvider } from '../providers/network/network';
17+
18+
@NgModule({
19+
...
20+
providers: [
21+
...
22+
Network,
23+
NetworkProvider,
24+
],
25+
})
26+
```
27+
28+
*app.component.ts*
29+
30+
```ts
31+
import { NetworkProvider } from '../providers/network/network';
32+
33+
@Component({
34+
templateUrl: "app.html"
35+
})
36+
class MyApp {
37+
constructor(network: NetworkProvider) {
38+
...
39+
network.detectNetwork();
40+
....
41+
}
42+
...
43+
}
44+
```
45+
46+
### Todos
47+
48+
- Add Network Detection on first run of the application
49+
- Add screenshots to README
50+
51+
License
52+
----
53+
54+
MIT

0 commit comments

Comments
 (0)