Comments (6)
Hey,
Would you mind making a sample project delineating the problem and solution?
I've never come across this issue.
Thanks!
from siren.
@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.
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.
@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.
Will look into this after the Swift 2 branch is merged.
from siren.
Fixed in Swift 2 branch.
Thanks!
from siren.
Related Issues (20)
- How to fix the error "Error retrieving App Store data as the JSON results were empty"? HOT 1
- Siren_Siren.bundle: No such file or directory HOT 3
- Support SwiftUI? HOT 3
- Install github slack integration. HOT 7
- Can I have a different text in the alert depending on the type of alert displayed? HOT 3
- How to update StoredSkippedVersion from custom UI HOT 1
- Siren localization .croatian HOT 6
- Don't appear dialog when ckeck update as .onForeground HOT 2
- Alert doesn't appear the first time you open the app. HOT 3
- Show update alert in UIViewController issue HOT 1
- When rule is set to .critical, previous skipped version setting should be ignored HOT 4
- Relaxing the version check when app is ran from a simulator ? HOT 4
- Error retrieving iOS version as it returns wrong new version HOT 3
- This notification is very user-friendly HOT 1
- 对比多年前的 iVersion,今天的Siren还不够好
- Help resolving a version number mistake HOT 1
- Supporting older versions of iOS (iOS 13+) HOT 2
- Siren popup shows even though there's no newer version available HOT 2
- iOS request cache - question HOT 4
- How to change Rule or Alert Type in iOS? 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 siren.