I'm new to electron.js.I created a game using html,css and javascript. Right now the app is running offline on the client side.
But i want to access,analyse and change that app.One way this can be possible is to load game resources from a server,so i can have complete access and control over app.But i don't want to put heavy duty on server.
Basically i want app's resources loaded from the user's computer,also i want to control app.The electron.js app should be able to work offline also.
How can i achieve this?
Thanks.
You can use "electron online" npm plugin to check app is connected to internet or not. If app has internet access you can perform your action to send updates to serer otherwise you can store those actions in "electron-json-storage" and later when have internet connectivity may be on app launch or at any specific event you can send those local storage information to server.
Related
I am working on an ASP.NET Core Web Application (exeutable) with Kestrel, that runs on localhost. It is designed to start when the Windows user logs in, so each user has its individual instance running, and Kestrel assigns a free dynamic port on startup.
This app is used to open some specific documents in the browser. I would like to let users embed this into their website in an IFRAME. Well, this is the part when it gets tricky.
I want some bare minimum ajax communication between the website where the IFRAME is, and the ASP.NET Core Web App, but ... the website does not know the port where it should contact the Web App, because it's dynamic at startup.
I have been researching for a day, and tried a couple of solutions, without success. Basically, what I need is shared storage between the JavaScript and Web App.
What I have tried:
I have tried saving the port to browser.localStorage, but it's website specific, and I don't know the website where the script is running.
I have tried saving the port to cookies, but it's also website specific.
I have tried more complex solutions like the Web App listening on a Socket permanently on a port. Even though JavaScript can contact the Web App, it cannot tell you which user port it needs, because JavaScript doesn't know anything about the logged-in user.
Saving the port to the Registry or to a File from the Web App, then reading from JavaScript does not work, because JavaScript has no access to these storages.
The ultimate question is, is there any shared storage, procedure, or method that could be used to establish this problem with pure JavaScript, and ASP.NET Core?
I'm building a desktop app with Electron and React.
I need that the app runs always when the computer is on (cause it periodically make some api call to the web)
I want to ask if I need a local server or something to accomplish that and if yes how to do that.
Also I need to know if there is a way to access this single page app from my smartphone. Because if isn't necessary I don't want to use paas like aws.
Thanks
I have built a simple chat application using websockets as well as the node.js program.
The website at the moment only works on my own computer - if I open multiple tabs or browsers I can send messages which would appear on all the other open tabs.
I now want to publish the site on a server so other people can use it to chat from other devices.
I know how to publish this on a server, however I do not know how to publish it so it keeps working because at the moment I have to use the node.js program to run a java script file which makes it listen on a port. Obviously if I publish the site to a server, I won't be able to keep on prompting the node program to listen for the port.
So my question is - how do I publish this site to the server? Can I use node.js program with it? My server is filezilla where I transfer the files to.
Thanks
I have a AngularJS app (embedded in a Cordova app).
To get and set data, it uses a REST API (that runs on a Django backend server).
I need that the app keeps working for several features even if the network is down.
For example, I'm expecting this kind of behaviour:
Online Mode
A client does something in the app
a POST request (to create data) is sent to the API
The client gets a "Thank you for doing xxx"
Fallback offline mode
A client buys something on the app
The client gets a "xxx can't be done right now, but it will be done as soon as possible"
Nothing can be sent to the server since we're offline. So how to do? Is there a way to put the API requests in a queue that will be executed when we're back to online mode?
How would you technically design this? It seems there is lots of differents technologies for offline mode, and it's a little bit confusing to me. Any guidance would be welcome.
Thanks a lot.
I would like to use such app, that would make me feel stupid. But there is
You can check network status with this plugin.
https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md
Each request will need a switch between sending HTTP POST and saving POST data to local storage.
Then you would just create callbacks for following events:
document.addEventListener("offline", onOffline, false);
function onOffline() {
// Turn on saving to local storage
}
document.addEventListener("online", onOnline, false);
function onOnline() {
// Read local storage, send all requests
}
I'm not sure what the pressure in the comments are not to do this. We have this functionality in an app we are developing.
Basically we package up the iOS app as a Cordova wrapped web container and also run a local proxy server as part of the app. It passes all data through it to the web service. If the requests fail, it returns an identifier to the app so you can determine that the connection to the server is down, and the app then saves the requests to localStorage. That way the UI can adapt to being in "offline mode." you can later push data from the app through the proxy once the connection to the server is restored. The app connects directly to the proxy rather than to a webservice.
As far as I'm aware, there's not an easy library to solve this situation though, and you have to be aware of how the requests will affect the online application (can things go out of sync in your system, if the user runs requests that are cached until later?)
It is definitely something that can be done, though.
What is the best way to be notified via push notification mechanisms when an update is published to a pubsub node (openfire server) and the xmpp mobile client app is offline? Should the app launch in the background say every 30 minutes without user knowing it (How would I achieve that)?
I'm building a Jquery mobile app and want to use phonegap to package it for iOS, android and maybe other devices.
Edit1: I think it should be something like C2DM or APNS. But how do I send a message from openfire server to C2DM/APNS when a particular user receives a message.
Edit2: How an XMPP server (e.g. openfire) would know whether to send the Push notification to the APNS or C2DM (because one user could have an Android or IOS device or both but the xmpp server doesn't know that)? If I'm asking the wrong questions, please correct me?
Thanks!
Natively, an XMPP server doesn't know anything about those protocols so it cannot push to them. You could create a plugin to push via some other means, but I think it would be simpler if you can get your client to connect every so often and get it's offline messages.