Giter VIP home page Giter VIP logo

react-native-wifi's People

Contributors

ethanswe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-wifi's Issues

Unknown SSID on android when using the library

I use the sample call as follows

WifiManager.getCurrentWifiSSID()
.then((ssid) => {
console.log("Your current connected wifi SSID is " + ssid)
}, () => {
console.log('Cannot get current SSID!')
})

And i get the result on android. I checked that the persmission are all there even though I have asked for them in the app
Your current connected wifi SSID is

getCurrentWifiSSID does not work in my project

I'm a newbie with react native and I am trying to use react-native-wifi in my app but nothing is working for me.

I am probably missing something stupid, but like I said I am learning react-native.

So, I npm installed react-native-wifi to my project and linked it
imported WifiManager into my component

I linked a function to a button to call WifiManager.getCurrentWifiSSID() as a test.

That is where i'm blocked... when I tap my button I'm getting an error message : "undefined is not a an object (evaluating '_reactNativeWifi2.default.getCurrentWifiSSID')

What I'm I missing?

Here are my dependencies from package.json
"dependencies": { "expo": "^30.0.1", "native-base": "^2.8.1", "react": "16.3.1", "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz", "react-native-wifi": "^1.0.1", "react-navigation": "^2.18.0" }

Can't get it working in iOS

So I'm just running the simple case of WifiManager.getCurrentWifiSSID, I've added the import, ran the link command, turned on the WiFi and Hotspot capabilities in Xcode. Build->run, but I get the error "Unhandled JS Exception: null is not an object (evaluating '_reactNativeWifi.default.getCurrentWifiSSID", basically, WifiManager is null, same on console.log. Do I need to 'inject' WifiManager?? Am i missing something obvious? Any help much appreciated!

Read SSID not working with iOS React-Native 0.57

Best I can tell this is a compatibility issue with the latest React-Native version on iOS (Android works fine).

I get this warning when loading the app:
screen shot 2018-09-22 at 17 25 31

And this error when calling getCurrentWifiSSID()
screen shot 2018-09-22 at 17 25 19

IOS: RequiresMainQueueSetup

In iOS A warning appears on startup:

"Module WifiManager requires main queue setup since it overrides constantsToExport but doesn't implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly option-out of."

[Question] How to join Wifi network once?

Good morning, in native Swift with iOS 11, we can programatically connect in the Network and DONT SAVE the configuration, every single time when the user go to connect in the network, the user will go and open the app every time. Follow the code.

var config = new NEHotspotConfiguration(Ssid, Pw, false);
config.JoinOnce = true;

It's possible to do the same using this plugin? There is a property to turn this behaviour?

connectTo Method it's crashing

At line 283 theres a peace of code, I'm getting this error when I trying to connect to WIFI- WPA/WPA2 PSK:

283 - boolean enableNetwork = wifi.enableNetwork(updateNetwork, true);
284 - if ( !enableNetwork ) {
285 - return false;
286 - };

ENVIROMENT:
RN: 0.54.0
react-native-wifi: 1.0.1
node: 8.9.1
npm: 5.6.0

Digging on Android developers documentation I found this...

image

Imported asset WifiManager is null

I installed with npm and linked with react-native link but the imported asset I get is always null. Is there something wrong with my setup or something I'm not doing correctly?

This is the exact error

TypeError: null is not an object (evaluating '_reactNativeWifi.default.connectToProtectedSSID')

For clarity, I am using Expo and this is my process:

  1. expo init project-name
  2. cd project-name
  3. npm i react-native-wifi
  4. react-native link react-native-wifi
  5. [add example code from README to expo App.js]
  6. expo start

At that point it fails on the connectToProtectedSSID() method with the error stated above.

package name should not be com.reactlibrary

this is the default package name and should be changed (For example this could be changed to com.blackdeve)

since it's the default this can cause issues when having another RN module that leaved the same default package name.
also, package name should be meaningful IMHO

connectToProtectedSSID fail to conect

I am trying to use the connectToProtectedSSID function and I always get the connection failed alert on my android phone.

I am able to get the wifi list, the current SSID, etc...

Could I be missing some configuration somewhere?

Is there a specific way to send the SSID and Password to the function?

I am using a Oneplus 6 phone and on Android 9

If you need more info, let me know.

Thanks

IOS: crashes every time after connect

I can successfully run WifiManager.getCurrentWifiSSID() however when I run WifiManager.connectToProtectedSSID(ssid, pwd, false), the ssid is connected to but I get a "red screen" error page:

Runtime is not ready for debugging. Make sure Packager server is running.

RCTFatal

-[RCTCxxBridge handleError:]

__21-[RCTCxxBridge start]_block_invoke

invocation function for block in facebook::react::(anonymous namespace)::RCTObjc

__58-[RCTWebSocketExecutor _executeJSCall:arguments:callback:]_block_invoke

__44-[RCTWebSocketExecutor sendMessage:onReply:]_block_invoke

...

There is no error message in the logs and this is 100% reproducible ie happens every time on iPhone 6.

Android: crash/native error on connect if wifi disabled

it would be nice to include an "enable wifi" function, or at least an "is wifi enabled" function...

However, when executing connectToProtectedSSID with wifi disabled, I get the following exception:

"Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference"

connectTo RNWifiModule.java:261
connectToProtectedSSID RNWifiModule.java:186

loadWifiList for iOS

This is on overall very nice package, especially with the loadWifiList method :D
Could you please create the method loadWifiList for iOS for consistency?

DEPRECATED LIBRARY

Please use https://www.npmjs.com/package/react-native-wifi-reborn

The administrator of this repository has not done so about two years ago, issues and PR are welcome in the new repo.

App-Prefs:root=WIFI app store rejection

Hi there,

I recently tried to submit my app to the appstore with this package and it was rejected for using a non-public URL scheme. In particular they were unhappy about the fact that App-Prefs was being used.

I am not too clued up with native code, but I've read that using UIApplicationOpenSettingsURLString would be a viable alternative. I would just like to know how to go about implementing this?

Error callback doesn't execute

Hello, i'm on MIUI 9.6.2(Android 7.1.2) and, as the title says, i can't get the error callback to execute. Even when i put in the wrong password for the network, i get the success message.

this is the function i'm executing:

async connectToWifi(ssid, password) {
      console.log('SSID', ssid)
      console.log('PASSWORD', password)
      this.setState({status: 4})
      WifiManager.connectToProtectedSSID(ssid, password, false)
          .then(() => {
              console.log('Connected successfully!')
          }, () => {
              console.log('Connection failed!')
          })


  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.