Kullanım android.support.v4.app.ActivityCompat.requestPermissions veya android.app.Activity.requestPermissions nasıl yapabilirim? her zaman tanımsız ÇünküNativeScript RequestPermission
Bu
var context = android.content.Context;
var wifi_service = application.android.context.getSystemService(context.WIFI_SERVICE);
wifi_service.setWifiEnabled(true);
var rs = wifi_service.startScan();
console.log(android.support.v4.app.ActivityCompat.requestPermissions); // undefined
console.log(android.support.v4.content.ContextCompat.requestPermissions); // undefined
application.android.registerBroadcastReceiver(
android.net.wifi.WifiManager.SCAN_RESULTS_AVAILABLE_ACTION,
function onReceiveCallback(context, intent) {
var tp = wifi_service.getScanResults();
console.log(tp); // empty []
console.log(tp.size()); // 0
});
ama dizi tp her zaman boştur yapmak istiyorum ve ben sağ izni gerektiğinden ve android, 6 biz
istemeniz anlamına i şey<uses-feature android:name="android.hardware.wifi" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" />
da C ekleyin: i de manifestfile eklemek
... \ app \ App_Resources \ Android \ app.gradle:
dependencies {
compile "com.android.support:support-v4:+"
, compile "com.android.support:appcompat-v7:+"
}
Teşekkür