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
Small fix for iOS version detection #84
Small fix for iOS version detection #84
Conversation
Update fork
…vailable theme options)
Oh, I forgot to update the changelog... again ':D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked into the bundle id change, and I can't find why it has done it. The good thing is that there hasn't been any iOS release yet, so it isn't a very big problem.
Maybe you have set a setting in xcode somewhere?
lib/bloc.dart
Outdated
@@ -175,8 +175,7 @@ class SettingsBloc { | |||
} | |||
} else if (Platform.isIOS) { | |||
final ios = await deviceInfo.iosInfo; | |||
// TODO: check what systemVersion returns on an actual iOS device. | |||
if (int.tryParse(ios.systemVersion, radix: 10) >= 13 /* iOS 13*/) { | |||
if (double.tryParse(ios.systemVersion) >= 13.0 /* iOS 13.0 */) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably never happen but double.tryParse
will return null
if it could not parse the number. And null >= 13.0
will throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually threw these exceptions on iOS when it was int.tryParse instead of double.tryParse. Which also created a never ending Circular Progress Indicator on the settings page where the dropdown menu for the "preferred theme" is.
Should I surround the if-condition with a try-catch where it does simply nothing if it catches an exception (= return false)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about saving the result of double.tryParse()
to a variable and extending the if to if (version != null && version >= 13.0)
Maybe crash the app if the version is null
and we are running in debug mode.
Yeah just use Version 1.1.2+7 RC The RC means release candidate, as in it hasn't been released yet (we're still working on it) |
Thanks for the feedback. I'm going to update the PR later today. |
… value != null, revert changes made to iOS bundle identifier
This PR refers to this comment on issue #26.
The answer to
// TODO: check what systemVersion returns on an actual iOS device.
(comment in lib/bloc.dart)is that
ios.systemVersion
actually returns the string representation of a double instead of an int. So the fix for this was quite simple.Debugging output before I made the changes:
There are also many auto-generated changes made by XCode during the iOS build. Most of them look like dependency-updates. But for some reason, it also automatically changed the "PRODUCT_BUNDLE_IDENTIFIER" from
"com.jeroen1602.lighthousePm"
to
"com.jeroen1602.VrLighthousePm".
I have no idea why. @jeroen1602 is this new bundle identifier correct or do you have an idea why this happened?