Git Product home page Git Product logo

Comments (6)

ArtSabintsev avatar ArtSabintsev commented on June 1, 2024

Hey,

Would you mind making a sample project delineating the problem and solution?

I've never come across this issue.

Thanks!

from siren.

rex3du avatar rex3du commented on June 1, 2024

@ArtSabintsev
Please just use your sample project and add

func applicationWillEnterForeground(application: UIApplication) {
Siren.sharedInstance.checkVersion(.Immediately)
}
func applicationDidBecomeActive(application: UIApplication) {
Siren.sharedInstance.checkVersion(.Daily)
}

into your delegate class. Try open the app and press home button and go back again. Clicking the next time button will crash the App.

from siren.

m-herold avatar m-herold commented on June 1, 2024

Hi,

I think that checkVersion(_:) with parameter SirenVersionCheckType.Immediately should not be called from applicationWillEnterForeground(_:) and/or applicationDidBecomeActive(_:)) because that could lead to several alerts displayed on top of each other (e.g. in the situation that rex3du described) which can be a problem when not using SirenAlertType.Force (like shortly mentioned in the readme).

When using any other SirenAlertType where the alert can be dismissed the hideWindow() gets called each time you close the alert - at least when using UIAlertController (iOS 8).
In this method Siren.updaterWindow is set to null (#515) which leads to a crash when closing the second alert (#514: "unexpectedly found nil while unwrapping an Optional value").

When you need to call checkVersion(.Immediately) from e.g. applicationWillEnterForeground(_:) and you do not want to have several alerts on top of each other I would suggest executing the code in checkVersion(_:) only if Siren.updaterWindow is nil.

Thanks for your great work on this excellent project!

from siren.

rex3du avatar rex3du commented on June 1, 2024

@m-herold your are correct. checkVersion(.Immediately) causes the issue. @ArtSabintsev I suggest remove the example in the Setup Instruction which is using checkVersion(.Immediately) from e.g. applicationWillEnterForeground(_:).

from siren.

ArtSabintsev avatar ArtSabintsev commented on June 1, 2024

Will look into this after the Swift 2 branch is merged.

from siren.

ArtSabintsev avatar ArtSabintsev commented on June 1, 2024

Fixed in Swift 2 branch.

Thanks!

from siren.

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.