Repository navigation
fix: Surveys 2.0 native fixes - #48
Merged
Merged
Conversation
…ion in start-survey Like the JavaScript SDK: a resume reminder continues the server's copy of the response and a Surveys 2.0 response records the outbound action that delivered it. A missing format no longer crashes the start (dictionary literal with nil). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vey keyboard scrim The messenger saves v2 answers itself and reports completion as notify-event outbound-sent, which only flow-started was handled for. It now calls feedbackSent: and outboundSent: in the legacy shape (outboundId, outbound, formData, plus responseId/endingId) and tracks outbound-<id>-submitted. survey-* lifecycle and shell layout messages are accepted as no-ops. Card surveys: while the keyboard is up WebKit scrolls the focused field into view and the uncovered strip is not page, so the translucent keyboard showed the app undimmed. A scrim rgba(10,12,16,0.25) behind the web view follows the keyboard frame; elsewhere the page's own dim stays the only one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ap user Every web view got a fresh nonPersistentDataStore, so a survey reopened in the same app session lost its localStorage (answers so far). They now share one private store; it is replaced when the session's gleapId changes (clear identity, another user) so form drafts and survey state never reach the next user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nce per response; announce surveyCallbacks
feedbackSent: gets {formData: <answers by key>, type: "SURVEY"} like a sent
legacy survey (GleapFeedback getFormData), not the bare answers. outboundSent:
passes on everything the messenger reports (surveyId, responseId, endingId,
status) next to outboundId/outbound/formData. A response is reported once per
app session, also when the page reports it again.
config-update carries surveyCallbacks: true, so the messenger sends this SDK no
legacy send-feedback after a completion (older SDKs get one, which the server
acknowledges without storing anything, to fire the same callbacks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surveys 2.0: native iOS fixes
Surveys 2.0 already render in released iOS SDKs, because the survey UI is the Messenger-App web view. This PR fixes what only the native side can:
feedbackSent:andoutboundSent:fire for 2.0 completions;No public API changes and no version bump; the synced SDK release comes later. No wrapper changes are needed, because Flutter, React Native and Capacitor keep forwarding the same delegate callbacks.
Head at time of writing:
ce1daf4(4 commits). Program overview, master rollout and risks: https://github.com/GleapSDK/Server/pull/2011. Pairs with https://github.com/GleapSDK/Messenger-App/pull/238 and GleapSDK/Android-SDK#44.Scope
outboundSent:/feedbackSent:fire for v2 surveys.notify-eventoutbound-sent. The SDK used to handle onlyflow-started.GleapFrameManagerViewControllernow callsfeedbackSent:with{formData: <answers by key>, type: "SURVEY"}, the shapeGleapFeedbackreports a sent legacy survey in.outboundSent:getsoutboundId,outboundandformDataplussurveyId,responseId,endingIdandstatus: "completed".outbound-<id>-submittedlike a legacy survey, and reports a response once per app session even if the page reports it again.config-updateannouncessurveyCallbacks: true.survey-shown/-answered/-completed/-closed/-legacy,sheet-viewportandheight-updateare accepted as explicit no-ops.GleapEventLogHelper parseUpdate:(ping and WebSocket actions) used to pass only flow and format.start-surveynow carriesresume,resumeData(=action.datawhen resuming) andoutboundAction(=action._id || action.id), like the JS SDK.formatno longer crashes the start: the dictionary literal no longer gets nil, and the format defaults tosurvey.show-surveyactions are unchanged.rgba(10,12,16,0.25)behind the web view follows the keyboard frame and its animation curve.GleapWebViewSupportcreated a freshnonPersistentDataStoreper web view, so a survey reopened in the same session lost its localStorage.gleapIdchanges (identity cleared, another user), so drafts never reach the next user. A test covers this.(Items 3, 4 and 6 of the program are Android-only, see Android-SDK#44.)
Old SDKs (7.0–19.1) without this PR: the messenger sends them one legacy
send-feedbackafter a v2 completion (Messenger-App795b738). The Server answers it with 201 and stores nothing (Servered8744886), so theirfeedbackSent:/outboundSent:and the submitted event fire too.Risk and safety
feedbackSent:now fires once per 2.0 completion, as it did for legacy surveys.gleapIdreset is what keeps one user's survey state from the next; it is covered by a test.xcodebuild test -scheme Gleapon the iPhone 17 simulator (what.github/scripts/test.shruns): 125 tests, 0 failures, re-run on 2026-10-07 atce1daf4(level withmain, nothing to merge). That includes the newtestWebViewsShareTheirStoreUntilTheGleapUserChanges. No new warnings in the touched files. (swift buildalone targets macOS, which this UIKit package does not support.)widgetOpened→feedbackFlowStarted→feedbackSent+outboundSentonce →widgetClosed, with no ticket created and one survey response each. Message shapes were checked against Messenger-App#238 and the JS SDK.Rollout (this repo)
This PR is independent of the web rollout: released SDKs keep working through the Server ack. Release it with the next synced native SDK version (iOS, Android, then Flutter, React Native and Capacitor through the
sdk-releaseflow) after Server#2011 and Messenger-App#238 are live. Merge together with Android-SDK#44. Master checklist: https://github.com/GleapSDK/Server/pull/2011.Surveys 2.0 PRs
🤖 Generated with Claude Code