onesygnal 1.0.1
onesygnal: ^1.0.1 copied to clipboard
OneSygnal Flutter SDK — in-app surveys triggered by user events.
1.0.1 #
Fixes #
- Android: the native
onesygnal-sdkAAR dependency was pinned to0.1.0regardless of which native SDK version was actually current at release time —1.0.0shipped depending on this same stale0.1.0AAR. The publish pipeline now resolves it to the real native release version. - The
WRAPPER_VERSION/wrapperVersionidentifiers this plugin reports to the native SDK (surfaced inclientContext/$lib_versionon tracked events) had drifted to"0.4.0"in the published1.0.0package instead of tracking the actual package version — the publish pipeline now stamps both to the real release version.
1.0.0 #
Initial public release on pub.dev.
0.4.0 #
The Android host-app requirement from 0.2.0 is gone: SurveyWindowOverlay now supplies its own
Lifecycle/ViewModelStore/SavedStateRegistry/OnBackPressedDispatcher owners instead of
borrowing the host Activity's, so a plain class MainActivity : FlutterActivity() works again.
Hosts that added the ViewModelStoreOwner/SavedStateRegistryOwner/OnBackPressedDispatcherOwner
ceremony documented under 0.2.0 can revert their MainActivity back to that one-liner.
0.3.0 (breaking) #
Every Future this package returns previously resolved before the native work it represents had
actually happened — the channel reply was sent on the line right after the native call was
dispatched, not once it finished. await identify('u1'); track('purchase') could evaluate against
the outgoing anonymous user instead of the newly-identified one, and await shutdown(); await initialize() could leave the SDK dead for the rest of the process (shutdown cleared
initialized inside its own async work, after initialize had already seen it still true and
no-opped). Native (apps/android-sdk, apps/ios-sdk) now answers every completion from inside the
async work itself, on every path, so await means what it says on both platforms.
Breaking changes #
identify(userId, {attributes})andinitialize()now returnFuture<bool>(wereFuture<void>) —identifyreports whether the identify call succeeded,initializewhether the SDK became ready. Existing callers that don't use the return value are unaffected.initialize()'s future (and thereadyevent) now resolve only once native setup has fully finished — config fetched, user ensured, surveys fetched, rules engine loaded — not the instant the call is dispatched. On a poor network this is bounded by the native HTTP timeouts (Android: 10s connect / 15s read; iOS: 15s request / 30s resource) times up to four sequential calls, so it can now take noticeably longer than before. Do not block UI onawait initialize(); show an "Initializing…" state instead (seeexample/).logout()/reset()/shutdown()keep theirFuture<void>signature, but now also resolve only once the native work has actually finished, not just once it was dispatched.
Fixes #
- Removing an event listener (
removeEventListener/disposing anOneSygnalEventListener) and then adding a new one used to duplicate every subsequent native event delivery — a widget that registers ininitStateand removes indisposeaccumulated one extra callback per navigation cycle, since neither native plugin actually released its native listener on cancel. Both native SDKs'on()now returns a handle that's cancelled ononCancel(and on engine detach), so a removed listener stays removed.
0.2.0 (breaking) #
Converted from a from-scratch Dart implementation to a thin, non-federated Flutter plugin
bridging to the native Android and iOS SDKs — see
docs/native-sdk-port/04-flutter-bridge.md
for the design behind this change, and ARCHITECTURE.md for the resulting
channel contract. Surveys now render as a native, OS-level window overlay above the entire app
(Flutter content included) instead of an embedded Flutter widget.
Breaking changes #
init(apiKey, {host, locale, trackPurchases})→ split intosetApiKey(apiKey),setLocale(locale)(both optional, called beforeinitialize()), andinitialize()(no arguments).hostis no longer configurable at all (the native SDKs hardcode it);trackPurchaseswas already dead code.track(eventName, {properties})now returnsFuture<bool>(wasFuture<void>) — reports whether the event was actually recorded.on(String event, Function callback)replaced by typed event listeners:addOneSygnalEventListener/removeOneSygnalEventListenerwithOneSygnalEventListenerInterface/OneSygnalEventListener, and typed event classes (SurveyShownEvent,SurveyCompletedEvent,SurveyDismissedEvent,QuestionAnsweredEvent).navigatorKeyremoved, with no replacement — no longer needed now that surveys render natively.surveyCompleted()/surveyDismissed()removed from the public API — response capture happens inside the native renderer now.init(testDio:)andresetForTesting()removed — test seams move to channel mocking (TestDefaultBinaryMessenger).
New #
questionAnsweredevent — the SDK now notifies host-app listeners as each question is answered, not just on survey shown/completed/dismissed (previously only tracked internally as an analytics event).
Android integration requirement #
- Your
MainActivity.ktmust implementViewModelStoreOwner,SavedStateRegistryOwner, andOnBackPressedDispatcherOwner— Flutter's defaultFlutterActivityimplements none of them. Missing the first two means surveys never render (no crash, no error); missing the third crashes the app on a Dropdown question. SeeARCHITECTURE.mdandexample/'sMainActivity.kt.
0.0.1 #
- TODO: Describe initial release.