NativeScript command to keep screen always on - nativescript

I am developing an app by NativeScript (+vue),
How can I force Android to keep the screen on, while the app is running and focused?

You may use nativescript-insomnia plugin for the same.
Install
tns plugin add nativescript-insomnia
Keep awake
insomnia.keepAwake().then(function() {
console.log("Insomnia is active");
});

Related

nativescript 7 - Live reload is working only once

I've installed latest version on Nativescript as documentation says:
nativescript Full setup with javascript
Everything went fine, so next i did setup my first project: tns create HelloWorld
Next i started the project using npm run ios
Iphone emulator has started, and when i made first change to text label, i saw that app refresh, but on second change conosle said that project is refreshed, but no changes on app. If i close app and run again, i see live reload only works once and next it igores any changes. My question is how to fix this.

Cordova Diagnostic plugin does nothing

This is my first cordova app and i'm trying to use the cordova.plugins.diagnostic plugin. I have it installed correctly i believe. On device ready I can alert that
alert(cordova.plugins.diagnostic != null) // returns true
// Appears to do nothing, i get no alerts
cordova.plugins.diagnostic.isLocationEnabled(function(enabled){
alert(enabled)
}, function(){
alert("ERROR");
});
I assume my error is with how i am running the app. I build the app via
cordova build ios
Then I run the build via xCode 9.4 to a local iPhone X
Any ideas on what i am doing wrong is much appreciated.
I have found the issue! Originally, when running
cordova build ios
I would receive and archive not found error, that i was essentially ignoring because it didnt seem to effect anything when built via xCode.
I resolved the error by running instead
cordova build ios --buildFlag="-UseModernBuildSystem=0"
Then, I can take the outputed .ipa file and install it onto my device via
Window > Devices and Simulators > {select device} > drag and drop ipa into app list
Running the app after this allowed for successfull response from isLocationEnabled!
I hope this answer helps someone else :D

React Native Debugger app will not open - debugger-ui opens in Chrome instead

My project is a create react native app project, using expo. I installed the react-native-debugger app a while back to debug redux and it was working fine. Recently, for an unknown reason, when debugging JS remotely it will only open http://localhost:19001/debugger-ui/ in Chrome, and will not connect to the React Native Debugger App. I have no idea why this has suddenly broken. This doesn't work for me as I can't use redux dev tools this way
My package.json has the following:
"devDependencies": {
"jest-expo": "30.0.0",
"react-native-debugger-open": "^0.3.17"
}
OS: Mac OS Mojave
Any ideas on how I can get expo to start using the desktop app again? I don't know what else to do beyond setting up the package.json correctly.
Can't comment cause my rep is under 50,
but I face the same issue on ubuntu 16.04 since this week.
Edit:
You can still use Reactotron in the meantime.
Here is the quick start section for react-native

Ionic 2 App crashes after splash screen on iOS - how to debug?

I have finally managed to install my Ionic 2 app on my iPhone with a development profile.
When I click the app icon it shows the splash screen, asks for Push permission (I am using Push) and then closes immediately. The same happens when I run it on the xCode simulator.
Any ideas where I can start debugging? This is the first time I am trying to deploy on iOS.
You are most probably using "phonegap-plugin-push" plugin to implement this feature. If that's the case then remove this plugin from your app and try to run it. If app doesn't crash then the problem is with the plugin.
Have you checked all the permission to use the push notification as specified in plugin's git page?

Cordova on WP8 - deviceready not fired

I've developed an application with Cordova, it actually works fine on Android and on iOS.
I want to try it on WP 7/8, but when I launched the app, it seems like the device ready event is not fired, so nothing works.
I use Cordova 3.1.0, I read somewhere that it could be cordova that is not loaded in VS2012.
Can someone help me ?
I solved it, the problem was not the deviceready event but the database initialisation.
Cordova database API isn't supported on Windows Phones. So it bug at the start when I init the DB while everything is OK on Android and iOS.

Resources