Coder Social home page Coder Social logo

Comments (14)

emotality avatar emotality commented on July 17, 2024

It's not suppose to. If the connection is not reachable it immediately stops the process:

Reachability *connection = [Reachability reachabilityWithHostname:@"itunes.apple.com"];
BOOL hasConnection = [connection isReachable];
if (!hasConnection) return;

I will test it again and get back to you.
Can you maybe tell me where you put this line of code?
So sorry for this!

from atappupdater.

emotality avatar emotality commented on July 17, 2024

I did some testing, and it works fine for me and others. You can email me the complete method you are calling ATAppUpdater from then I can try and see what seems to be the problem or you can troubleshoot it yourself by doing the following:

In ATAppUpdater.m :
Comment out all the code except for (id)sharedUpdater and then comment out everything inside (void)forceOpenNewAppVersion:(BOOL)force
If the app crashes it must be a thread problem because at this stage it has only initialized the singleton:

static ATAppUpdater *sharedUpdater;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
    sharedUpdater = [[ATAppUpdater alloc] init];
});

If the app did not crash, uncomment piece for piece until it crashes, you will be able to figure it out, if not, please tell me which line makes it crash then I will try. ;)
Sorry for this!

from atappupdater.

StormFactory avatar StormFactory commented on July 17, 2024

I think I followed the instructions properly. I'm calling [[ATAppUpdater sharedUpdater] forceOpenNewAppVersion:NO];

from inside
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

I removed ATAppUpdater from my project for now. I'll go back and try the suggestions you offered after I submit for review.

from atappupdater.

emotality avatar emotality commented on July 17, 2024

Yeah that was just an example. You can use it where ever you want to show the alert. :)
Try it at applicationDidBecomeActive in AppDelegate.m.

I will close this for now, anyone can open it at any time if they have the same issue.

Thanks for using ATAppUpdater and remember to add your app to the "Apps using this control" at https://www.cocoacontrols.com/controls/atappupdater

from atappupdater.

JeanLebrument avatar JeanLebrument commented on July 17, 2024

Hi @emotality, I've exactly the same problem as @StormFactory.

I use the ATAppUpdater in version 1.3 from Cocoapods.

I call the [[ATAppUpdater sharedUpdater] forceOpenNewAppVersion:NO]; at the very end of the method didFinishLaunchingWithOptions:.

I put a breakpoint at this line if (!hasConnection) return; and the value was YES despite I haven't network on my phone. (google.com is not reachable with Safari).

Here is the stack trace displayed after the breakpoint passed:

2015-08-25 13:42:44.884 MYAPP.[5102:b307] [Error]: Could not connect to the server. (Code: 100, Version: 1.7.3)
2015-08-25 13:42:44.885 MYAPP.[5102:b307] Network connection failed. Making attempt 3 after sleeping for 3.848020 seconds.
2015-08-25 13:42:46.042 MYAPP.[5102:af1b] [Error]: Could not connect to the server. (Code: 100, Version: 1.7.3)
2015-08-25 13:42:46.045 MYAPP.[5102:af1b] Network connection failed. Making attempt 2 after sleeping for 1.539635 seconds.
2015-08-25 13:42:47.834 MYAPP.[5102:6207] [Error]: Could not connect to the server. (Code: 100, Version: 1.7.3)
2015-08-25 13:42:47.835 MYAPP.[5102:6207] Network connection failed. Making attempt 3 after sleeping for 3.079271 seconds.
2015-08-25 13:42:49.089 MYAPP.[5102:7f0b] Tapstream Error: Failed to fire event, error=Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo=0x17e48ba0 {NSErrorFailingURLStringKey=https://api.tapstream.com/MYAPP/event/ios-MYAPP_-open/, NSErrorFailingURLKey=https://api.tapstream.com/MYAPP/event/ios-MYAPP_-open/, NSLocalizedDescription=Could not connect to the server., NSUnderlyingError=0x17d30900 "Could not connect to the server."}
2015-08-25 13:42:49.090 MYAPP.[5102:6207] [Error]: Could not connect to the server. (Code: 100, Version: 1.7.3)
2015-08-25 13:42:49.093 MYAPP.[5102:6207] Network connection failed. Making attempt 4 after sleeping for 7.696040 seconds.
2015-08-25 13:42:49.093 MYAPP.[5102:b307] Tapstream Error: Failed to fire event, error=Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo=0x17e5c0d0 {NSErrorFailingURLStringKey=https://api.tapstream.com/MYAPP/event/ios-MYAPP-install/, NSErrorFailingURLKey=https://api.tapstream.com/MYAPP/event/ios-MYAPP-install/, NSLocalizedDescription=Could not connect to the server., NSUnderlyingError=0x17e62e30 "Could not connect to the server."}
2015-08-25 13:42:51.029 MYAPP.[5102:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
*** First throw call stack:
(0x2df67ecb 0x38702ce7 0x2df67e0d 0x2e8f5967 0xfc751 0xfc463 0xd5d77 0x30808ca1 0x308085f3 0x30802ca9 0x3079ec77 0x3079ddd9 0x308023e5 0x32e0bb55 0x32e0b73f 0x2df32807 0x2df327a3 0x2df30f6f 0x2de9b729 0x2de9b50b 0x3080160b 0x307fc871 0xf0cad 0x38c00ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException

Any suggestion?

from atappupdater.

emotality avatar emotality commented on July 17, 2024

Hi, I tested this on a device and it worked. But when I tested it on the Simulator, I got the same crash as you guys.

Reachability is NOT supported on Simulators, sorry!

Can you confirm? Thanks. :)

from atappupdater.

JeanLebrument avatar JeanLebrument commented on July 17, 2024

I test on my iPhone 6 on iOS 8.

from atappupdater.

emotality avatar emotality commented on July 17, 2024

Okay I got a fix, will update to 1.4 and let you know.

from atappupdater.

emotality avatar emotality commented on July 17, 2024

Fixed with commit: a0e63e0

Let me know if this worked for you guys! 👍

from atappupdater.

gabreho avatar gabreho commented on July 17, 2024

I still got the crash with the latest version using a slow internet, as if showUpdateWithConfirmation is making a synchronous request, the app goes black until it responds.

from atappupdater.

foffux avatar foffux commented on July 17, 2024

@gabreho could you please give some more details on how to reproduce this issue so that @emotality can check and fix if needed.
I had not the chance to test this pods and so I worry about any crashes.
Thank you.

from atappupdater.

gabreho avatar gabreho commented on July 17, 2024

@foffux @emotality just call showUpdateWithConfirmation in applicationDidBecomeActive but using a slow internet connection, the screen will go black until it get a response.

from atappupdater.

foffux avatar foffux commented on July 17, 2024

Ah okay so not a great issue.
Why call that method? I do not remember to have used at all. Just initialized it. Is this a mistake or the update question will pop anyway?
In other word: is this an advanced usage and the normal one for asking for an update will work or not?
Thank you very much

from atappupdater.

emotality avatar emotality commented on July 17, 2024

Fixed with commit: 58a3d41
Thanks @gabreho @foffux

Now running in a background thread.
The request now takes between 500ms - 2500ms on 3G 😞

from atappupdater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.