Comments (13)
Have you tried window.location.reload()
? That might do what you want, I think.
from mobile-packages.
I think location.reload would not do that, as it reloads to meteor.local
and doesn't restart the on-device server.
from mobile-packages.
Oh wait, I am wrong. The Reload
call happens after the new data was downloaded and server restarted (https://github.com/meteor/meteor/blob/devel/packages/autoupdate/autoupdate_cordova.js). location.reload might do the trick :)
from mobile-packages.
Works in the iOS simulator, thanks! Maybe add that as a possible use of Reload.isWaitingForResume()
at the bottom of the readme?
from mobile-packages.
Great idea, just added that. Thanks!
from mobile-packages.
Is there a meteor package similar to https://atmospherejs.com/mdg/reload-on-resume but for desktop clients? I mean a package that changes the behavior of Meteor's hot code push feature and allows us to attache custom code and define what happens when a new version is downloaded or detected.
I think doing a full page reload (for example by calling window.location.reload()
) eliminates the risk of getting some invalid app state and the need to manually reset any variables or components. IMO it is not a big deal if a user needs to refill some form when this happens.
from mobile-packages.
The way hot code push is implemented currently actually does do a full page reload for exactly this reason. You can attach hooks to reload related events via the reload
package, but I don't think the API is well documented. Look at the source code of this package for an example of how to use it.
from mobile-packages.
@stubailo Thanks, good to know :)
You mean I should take a look at this package ? =>
https://github.com/meteor/meteor/tree/devel/packages/reload
from mobile-packages.
That would also be helpful, but I meant the mdg:reload-on-resume
package, since it uses the reload
API.
from mobile-packages.
Okay :) I'll take a look.. THX
from mobile-packages.
If we use window.location.reload()
connection to the server is lost and we are getting
Server sent add for existing id: 5JHx7YWauQobBXC7H
error
but that record is not existed after the reload.
Is there any smooth way to do this like Reload.update()
?
My code
function initializeUpdate(){
document.addEventListener('resume', function(){
if(Reload.isWaitingForResume()){
window.location.reload();
}
}, false);
}
document.addEventListener("deviceready", initializeUpdate, false);
from mobile-packages.
This is more of grounddb
issue I think
Meteor-Community-Packages/ground-db#22
from mobile-packages.
+1
from mobile-packages.
Related Issues (20)
- no plugin found for camera.less in mdg:camera HOT 19
- Update and upgrade
- How to localize/translate mdg:camera HOT 1
- geolocation does not work with Meteor 1.4+ HOT 4
- Reset and retrieve again GeoLocation values HOT 1
- geolocation is showing null. HOT 2
- Image quality (mdg:camera) HOT 1
- Camera problems ( mdg:camera)
- After upgrading to Meteor 1.5.1 .latLng() and .currentLocation() return null HOT 3
- Geolocation.currentLocation() not working, giving null value using meteor(1.5.1) & mdg:geolocation(1.3.0) HOT 5
- Decide what to do about mdg mobile-packages HOT 2
- Apple requires me to customize the notification prompt that asks the user for permission HOT 3
- Locale not work in mobile, I use this and work for me HOT 1
- On cordova mdg:geolocation doesn't wait for the cordova-geolocation-plugin to be ready HOT 1
- Still maintained? HOT 3
- mdg:camera using deprecated Chromium API HOT 5
- Will the plugin save the image to the mobile device HOT 1
- Failed to execute 'createObjectURL' HOT 2
- mdg camera uses underscore
- mdg:camera incompatibility with latest meteor version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobile-packages.