Repository navigation
Stories over API v3 as the web SDK - #32
Merged
Merged
Conversation
…s over API v3 carry sid, the device's A/B segment, the stream and testmode as the web SDK does, poll answers and reviews carry sid, stream, testmode and their source (source_type stories, the story and the slide as strings) instead of story_id and slide_id, and going back on the first slide sends view again
…vice for 90 days by did, poll kind, code, story and slide as the web SDK keeps them, the feed's answer winning over the saved one; a rate whose band has a question asks it with a comment field of up to 5000 characters and sends the same rate with the comment, then the band's success; the card shows what the web shows (no results header, no vote count, thanks_text after the rows), colours the scale with the kit's danger and warning tokens, sits at y_offset up to 16 above the slide's bottom, and its built-in texts are Russian or English by the device language
…y opens at the feed's start_position and where it was left in the session, it is viewed by the feed's viewed or once left forward; media is decided by the slide type and a slide without media takes its background_color; a header is drawn with the kit's type and its tap sends click and opens its link; a text block without font_size takes the kit's body size, text_italic and monospace are read; a button without a link only sends click; copying a promo code sends no click; Share hands over the slide's link or the story's as it is, without r46_slide. The old feed keeps the kit's rules
…3 — Universal Links and App Links on the shop's domain, then PersonalizationStoriesV3.handleLink — with the link format, marked as behind the v3 gate
…on's choice on the device and shows the button only for a video with an audio track, as the web SDK does; the bridges read the track list off the main thread (Android MediaMetadataRetriever, iOS AVURLAsset) through storiesVideoHasAudio, and a video whose tracks cannot be read keeps the button
…t on the device per shop, as the web SDK keeps it per site; a shop with no saved choice starts muted
…E, as v3 stays behind its gate; the text lives in the pull request
… nor video and has no product element, as the web SDK does (no view, going forward and back passes it, a story of such slides only is not shown), and a product slide without buttons has no More info button, as the web; the old feed keeps both
… is finished as the web SDK finishes it — viewed, the next story opens, after the last one the viewer closes; a story of skipped slides only stays in the bar, opening it passes on, and an empty viewer is never shown (show, handleLink and a swipe onto it too); a link's slide only sets the first open, then the story starts where it was left, and shared_open carries the slide it opened at
…PI v3 closes the viewer, as the web SDK does, instead of restarting the slide; going back into a story with nothing to show steps over it. The old feed keeps the restart
…gment before start_position: all of them once the story is viewed, none before, as start_position says where it opens and not what was seen
…ead of its own per read and gives up after 5 s, so a hanging network read neither holds the next ones nor leaves the answer pending; an answer that is late or unreadable keeps the sound button, as the button hides only when no audio track is confirmed; the viewer reads the cached file when the cache has filled meanwhile, and stops waiting for the bridge after 6 s
… its own instead of restoring the saved choice into the one the old viewers share, so the old feed's sound stays exactly as before; only the sound button's choice is saved per shop, volume up unmutes the viewer on top without saving it
…ase-insensitive font_type of text blocks are read only for stories over API v3, so the public getStories and the old feed keep the model and the text blocks of master
… or dark text by the higher WCAG contrast against its background_color instead of a luminance threshold, and its colours — the slide, its letterbox, a text block's text and background — are read by one parser, as CSS reads them on the web: #RGB, #RRGGBB, #RRGGBBAA, rgb() and rgba(); the old feed keeps its colours
…ext_bold only without it, italic from italic and else text_italic, each of true, 1 and "true", and read the background opacity as the web's calculateOpacity does: a number is percents ("0.5" is 0.5 %, "50" and "50%" are 50 %) and a background colour without an opacity is painted opaque; the old feed keeps its rules
…before it is saved and stays when saving fails, instead of being rolled back as a failed send; a percent JSON cannot write (NaN, infinity) is saved as the card shows it, and an encoding or storage error only skips the saved record
…nswer does — option ids, a non-empty text or a numeric rate — also for an answer sent in this process; what it shows goes from the answer sent from the same feed element, a freshly loaded feed's answer, an answer sent earlier in this process from the same place (with no did too), to the saved record; a saved record that cannot be read is deleted
…h as its own card at its own y_offset, as the web SDK renders each one, instead of the first only; the slide stands while any of its cards holds it
… of 12, and a card lifted to fit stays 16 above the bottom row (the sound button, Used products) while it is shown, else 16 above the safe area's bottom
…its text, under the cross row, and text blocks are laid out with it so they stand below it instead of under it, their y_offset still measured from the whole slide
…s: a back swipe on the first story closes the viewer as the web does, a story stepped over going back is marked viewed as going forward, a translucent background_color lies over the viewer's black also for the text scheme, and a valid opacity replaces the alpha of a #RRGGBBAA or rgba() text background while without one the colour keeps its own
…viewed and closes the viewer, and a vertical swipe longer than 100 up or down closes it, as the web SDK does; swipes are measured from the touch, as the web measures them, and the old feed keeps its swipes
…web SDK's English constants (Answer again, Failed to send the answer. Please try again, Send) whatever the device language, replaced by the element's labels and the poll's submit_label as on the web; the host's poll texts of PersonalizationStoriesV3 and handleLink take these defaults again, as on master
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.
Stories over API v3 (behind the v3 gate) follow the web SDK: requests carry sid, segment, stream and testmode, poll answers are saved on the device and carry their source, scales ask the band's question, and slides open, mark viewed, draw headers, media and colours as the web does. The old feed keeps the kit's rules.
Shared links
Stories over API v3 are behind the v3 gate: not part of the public API yet, reached
only through
package:rees46_sdk/src/v3/personalization_v3.dart.The "Share" button of a slide shares a link to the shop's site:
To open such a link in the app instead of the browser, the app claims the shop's domain:
Associated Domainscapability withapplinks:<shop domain>, andhttps://<shop domain>/.well-known/apple-app-site-associationlisting the app (
<team id>.<bundle id>) and the paths of the links.intent-filterwithandroid:autoVerify="true"forhttps://<shop domain>on the activity that opens links, andhttps://<shop domain>/.well-known/assetlinks.jsonwith the app's package name and theSHA-256 fingerprint of its signing certificate.
The app gets the URL as any deep link (for example through its router or an app-links
plugin) and hands it over: