[google_sign_in] Don't crash a misconfigured iOS app
In https://github.com/flutter/plugins/pull/1180 the plugin was deliberately made to crash when misconfigured. The reasoning was that the app shouldn't be released this way, which is true, but crashing the entire app means that a developer has to use Xcode to debug the app to understand what's happening, which is a very poor user experience.
The PR indicated that the error would be printed from the Dart side after that PR, but that's not actually what happens; method channel returns are asynchronous, whereas crashing the app on the native side with an unhandled exception happens immediately, so even though the native side does call the completion, the async process of that completion being received on the Dart side as a PlatformException was never happening, and the crash was silent outside the context of a native debugger.
This removes the throw, so that it can be received as a Dart exception, which is much easier for most developers to debug.
Pre-Review Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene page, which explains my responsibilities.
- [x] I read and followed the relevant style guides and ran the auto-formatter.
- [x] I signed the CLA.
- [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g.
[shared_preferences] - [ ] I linked to at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under[^1]. - [x] I updated
CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under[^1]. - [x] I updated/added any relevant documentation (doc comments with
///). - [x] I added new tests to check the change I am making, or I have commented below to indicate which test exemption this PR falls under[^1].
- [x] All existing and new tests are passing.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
There's no issue linked because this is something I just happened to hit while testing https://github.com/flutter/packages/pull/9484 locally, and had messed up the configuration in my test app.