Update approov_service_flutter_httpclient to ^3.5.8 and await initialize - #13
Conversation
Align README, SHAPES-EXAMPLE and the example app on the current pub.dev release. The three files previously disagreed (^3.5.5 vs ^3.4.1); the example lockfile already resolved to 3.5.6. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the documented/sample dependency version for approov_service_flutter_httpclient to match the latest published package version and align the quickstart documentation with the already-resolved lockfile version used by the example.
Changes:
- Bump referenced
approov_service_flutter_httpclientversion to^3.5.6in the main README. - Update the Shapes tutorial snippet to
^3.5.6for consistency. - Update the commented dependency hint in
example/pubspec.yamlto^3.5.6.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| SHAPES-EXAMPLE.md | Updates the tutorial dependency snippet to ^3.5.6. |
| README.md | Updates the documented dependency version to ^3.5.6. |
| example/pubspec.yaml | Updates the commented Approov dependency version to ^3.5.6. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In 3.5.8, a successful initialize() resets the service configuration. The example and docs called initialize() without await and then called addSubstitutionHeader(), so the reset deleted the header and the request went out with the placeholder API key. - Change the version to ^3.5.8 in example/pubspec.yaml, README.md and SHAPES-EXAMPLE.md. - Make main() async, call WidgetsFlutterBinding.ensureInitialized() and await initialize() in main() and in the isolate. - Show the await form in README.md and SHAPES-EXAMPLE.md. Tested on an Android 17 emulator with 3.5.8: without await, the server returned "invalid api key" and no substitution was attempted. With await, the substitution header stayed registered in the root isolate and in the background isolate. Refs approov/core-project-approov#647 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test with a real Approov account — 2026-09-29Tested at commit 6b1aa3b on a development Approov account, with
"api key valid" shows that the placeholder was replaced with the real API key, so the Local build note: the example needed Kotlin 2.1.0 to build with Flutter 3.41.6 (see the description). That change is not in this PR. 🤖 Generated with Claude Code |
| import 'package:approov_service_flutter_httpclient/approov_service_flutter_httpclient.dart'; | ||
| ... | ||
| ApproovService.initialize('<enter-your-config-string-here>'); | ||
| await ApproovService.initialize('<enter-your-config-string-here>'); |

Changes
approov_service_flutter_httpclient→ ^3.5.8 (latest on pub.dev) inREADME.md,SHAPES-EXAMPLE.mdandexample/pubspec.yaml. Before this PR, these three files did not agree (^3.5.5, ^3.4.1 and ^3.4.1).example/lib/main.dart:main()is nowasyncand callsWidgetsFlutterBinding.ensureInitialized(). The commented Approov lines now readawait ApproovService.initialize(...), inmain()and in the isolate.README.mdandSHAPES-EXAMPLE.mdshow theawaitform and explain why it is necessary.Why
awaitis necessaryIn 3.5.8, a successful
initialize()resets the service configuration (_resetServiceStateAfterSuccessfulInitialization()clears the substitution headers). The reset runs after the native initialization returns. The example and docs calledinitialize()withoutawaitand then calledaddSubstitutionHeader()at once, so the reset deleted the header. 3.5.6 has no such reset. See the 3.5.8 upgrade notes in the service layer CHANGELOG.Testing
On an Android 17 emulator with 3.5.8, secrets-protection flow, fake config string:
initialize()withoutawait(old docs)await initialize()(this PR)flutter analyzeon the committed example, as shipped and with all Approov lines uncommented, reports no new findings.Known issue (not caused by this PR)
The example pins Kotlin
1.8.22inexample/android/settings.gradle.kts. Current stable Flutter (3.41.6) cannot build it with any service layer version. The tests used Kotlin 2.1.0 in a local copy only.Refs approov/core-project-approov#647
🤖 Generated with Claude Code