Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meteor-Cordova iOS app - After some time in bg app completely loses connection to a local web server - http://localhost:{myPortNumber} #8324

Closed
grundmanise opened this issue Feb 7, 2017 · 7 comments

Comments

@grundmanise
Copy link

grundmanise commented Feb 7, 2017

Versions:

  • METEOR@1.4.2.3
  • iOS 10.2
  • iPhone 5s

Platforms:

  • browser
  • ios
  • server

Packages:

  • meteor-base@1.0.4 # Packages every Meteor app needs to have

  • mobile-experience@1.0.4 # Packages for a great mobile UX

  • mongo@1.1.14 # The database Meteor supports right now

  • blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views

  • reactive-var@1.0.11 # Reactive variable for tracker

  • jquery@1.11.10 # Helpful client-side library

  • tracker@1.1.1 # Meteor's client-side reactive programming library

  • standard-minifier-js@1.2.1 # JS minifier run for production mode

  • es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.

  • ecmascript@0.6.1 # Enable ECMAScript2015+ syntax in app code

  • reactive-dict@1.1.8

  • kadira:flow-router

  • kadira:blaze-layout

  • fourseven:scss

  • session@1.1.7

  • http@1.2.10

  • aldeed:simple-schema

  • aldeed:collection2

  • fastclick@1.0.13

  • dburles:google-maps

  • abpetkov:switchery

  • seba:minifiers-autoprefixer

  • zimme:active-route

  • momentjs:moment

  • udondan:slick

  • nolimits4web:swiper

  • accounts-ui@1.1.9

  • btafel:accounts-facebook-cordova

  • philippspo:momentum-flow-router

  • dschulz:jquery-qrcode

  • shell-server@0.2.1

  • ground:db

  • percolate:momentum

  • joncursi:socket-io-client

  • mrt:jquery-easing

Cordova plugins:

Problem
After the app was some time in bg state when I open the "minimized" app it loses connection to the local web server:

  • Safari console outputs: could not connect to http://localhost:{myAppPortNumber}
  • Xcode console outputs: "App startup timed out, reverting to last known good version".

location.reload(); - does not work - console outputs the same error: could not connect to http://localhost:{myAppPortNumber}.
Restarting the app from the CDVWKWebViewEngine.m with [(WKWebView*)_engineWebView reload]; - does not work.
Restarting the app from the WebAppLocalServer.swift using

    func forceReload() {
        if let webView = self.webView as? WKWebView {
            webView.reloadFromOrigin()
        }
    }

does not work.

The only solution is to completely close the app and reopen it.
(Note: all these restart & reload methods work until the app loses connection to the local web server.)

Does anyone have any thoughts?

  1. Is it possible to completely reload a cordova app? Google & SO says- 'no'
  2. Any thought on how to fix it?

p.s. I even use the solution from this isse transistorsoft/cordova-background-geolocation-lt#221 that should prevent the GCDWebServer from ever stopping.. it works for the BG location, but does not prevent my app from losing a connection to the localhost (local web server).

@grundmanise
Copy link
Author

Restarting localserver every time the app enters foreground does not help either. (grundmanise/cordova-plugin-meteor-webapp@9a414d8)

@awwx
Copy link
Contributor

awwx commented May 9, 2017

Possibly a duplicate of meteor/cordova-plugin-meteor-webapp#24 ?

@grundmanise
Copy link
Author

@awwx It's not the same. As stated above I already use:

cordova-plugin-meteor-webapp@https://github.com/grundmanise/cordova-plugin-meteor-webapp.git#011d9e8086628861d5b37c5aa26f71ac70f986de //@1.4.1 with this fix: meteor/cordova-plugin-meteor-webapp#24

@macrozone
Copy link
Contributor

@grundmanise did you find a solution or workaround yet for this problem in your project? We are really suffering from this problem and I don't really know what to do anymore.

@grundmanise
Copy link
Author

@macrozone Unfortunately no. We are currently migrating to RN...

@Slavrix
Copy link

Slavrix commented Jul 19, 2017

We are experiencing a this (or similar) issue. The first step we have taken is to add a call to Meteor.reconnect() within the platform resume event.

Though this hasn't fully fixed out issue yet either.

@hwillson
Copy link
Contributor

Since this is already being tracked in meteor/cordova-plugin-meteor-webapp#27, let's close it here. Thanks!

grundmanise referenced this issue in grundmanise/cordova-plugin-meteor-webapp Dec 31, 2017
…t completely loses connection to a local web server.

meteor#27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants