Skip to content

Commit 35f1a0c

Browse files
IvanIvan
authored andcommitted
Last master from upstream
2 parents 9281e07 + 3b236e9 commit 35f1a0c

100 files changed

Lines changed: 16984 additions & 2629 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
.mtj.tmp/
55

66
# Package Files #
7-
*.jar
87
*.war
98
*.ear
109

Example/__tests__/App.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

Example/ios/Example/AppDelegate.h

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5151
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5252

5353
[version]
54-
^0.63.0
54+
^0.67.0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ buck-out/
5151
*/fastlane/report.xml
5252
*/fastlane/Preview.html
5353
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle

Example/App.js renamed to Examples/Example/App.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
TextInput,
1313
TouchableHighlight,
1414
ScrollView,
15-
View
15+
View,
16+
PermissionsAndroid
1617
} from 'react-native';
1718

1819
import wifi from 'react-native-android-wifi';
@@ -34,7 +35,33 @@ export default class App extends Component<Props> {
3435
level: null,
3536
ip: null,
3637
};
38+
39+
}
40+
41+
componentDidMount (){
42+
console.log(wifi);
43+
this.askForUserPermissions();
44+
}
45+
46+
async askForUserPermissions() {
47+
try {
48+
const granted = await PermissionsAndroid.request(
49+
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
50+
{
51+
'title': 'Wifi networks',
52+
'message': 'We need your permission in order to find wifi networks'
53+
}
54+
)
55+
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
56+
console.log("Thank you for your permission! :)");
57+
} else {
58+
console.log("You will not able to retrieve wifi available networks list");
59+
}
60+
} catch (err) {
61+
console.warn(err)
62+
}
3763
}
64+
3865
serviceCheckOnPress(){
3966
wifi.isEnabled(
4067
(isEnabled)=>{
@@ -71,6 +98,7 @@ export default class App extends Component<Props> {
7198

7299
getWifiNetworksOnPress(){
73100
wifi.loadWifiList((wifiStringList) => {
101+
console.log(wifiStringList);
74102
var wifiArray = JSON.parse(wifiStringList);
75103
this.setState({
76104
wifiList:wifiArray,

0 commit comments

Comments
 (0)