Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use in Ionic? #28

Closed
nicothed opened this issue Oct 17, 2017 · 2 comments
Closed

How to use in Ionic? #28

nicothed opened this issue Oct 17, 2017 · 2 comments
Assignees
Labels

Comments

@nicothed
Copy link

Hi, this plugin looks exactly like what I need, but I'm not fully sure how to use it in Ionic... any idea? How can I access this object?

@salbahra
Copy link
Owner

I have added support to @ionic-native/network-interface via this PR danielsogl/awesome-cordova-plugins#2063. In the meantime you can declare the window reference as any in TypeScript to allow use as shown in this issue: #19

@salbahra salbahra self-assigned this Oct 25, 2017
@salbahra
Copy link
Owner

salbahra commented Dec 2, 2017

You can now reference this plugin using @ionic-native/network-interface:

npm install @ionic-native/network-interface
import { NetworkInterface } from '@ionic-native/network-interface';

constructor( private networkInterface: NetworkInterface ) {
    this.networkInterface.getWiFiIPAddress( ip => alert( ip ) );
    this.networkInterface.getCarrierIPAddress( ip => alert( ip ) );
}

@salbahra salbahra closed this as completed Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants