-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/add trigger session #31
Merged
Merged
Conversation
This file contains 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
- Added isoString conversion in encoder, rather than storing strings in paywallsession model. In the future we should make all dates use this. Using the old date formatter way of creating iso strings. - Added in experimentGroupId to trigger rule, and changed experimentId key. - Added in more variables to paywallsession.
Removed all optionality of paywallInfo in callbacks and updated docs to reflect that. **NOTE**: This is a breaking change and still requires a changelog entry. This solves: https://linear.app/superwall/issue/SW-517/remove-nullability-from-paywallinfo
Cherry picked a commit that's destined for 3.0. This removes the optionality of PaywallInfo. This commit reverses the breaking changes exposed to the developer by keeping paywallInfo optional in public.
Tracking the time when products fail to load.
Made TriggerSession codable and enueue and save the latest 20 to disk with each trigger session update. When the app is opened the next time, it fires off the last 20 triggersessions to the server. - Fixed schema issue when sending triggersessions.
- The app session now times out after 1 hour or according to the timeout sent via config. - A new id is created for a new app session, rather than just setting startAt. - Last 20 sessions saved to disk on resigning active rather than every time a session is enqueued. - Fixed and updated tests
- Logging partial success of events/session events endpoints. - Added and fixed tests. - Changed trigger sessions to create pending trigger sessions on config. These then get used when the trigger is fired.
- When loading the webview/products/paywallresponse, it now checks for the ID of the paywall before it tracks it. This is so that any preloading paywalls that are the ones to display (especially on session_start etc) can be logged. This negates the use of an `isPreloading` flag. - Fixes issue with session_start not getting fired.
It is recommended to use Decimal over Double for prices (Apple's prices come back as NSDecimalNumber, which is an interchangeable reference semantic version of a Decimal). However, the encoder doesn't like encoding Decimal values so we're now sending them off as strings in the postback.
4 tasks
Feature/parse expression js
…al-representation
- Updated both SDK documentation as well as function documentation. - Removed docs referring to presenting. - Removed unused public structs.
The sample apps now iterate over error codes to determine whether the presentation has indeed failed, or whether the user is in a holdout or noRuleMatch.
Also removed guide for presenting in the readmes for the sample apps
…mentation Feature/change internal documentation
…al-representation
…esentation Feature/pricing decimal representation
…rwall-me/paywall-ios into feature/add_paywall_session
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.
DON'T MERGE YET, CREATING FOR TESTING PURPOSES
Changes in this pull request
Checklist
CHANGELOG.md
for any breaking changes, enhancements, or bug fixes.I've added tests but this needs thorough real-life testing!
How it works
It creates the “pending sessions” from the config (one for each trigger + default paywall). These get enqueued and sent back to the server. Then when it gets to the relevant part it activates the session. Any activation/changes to the session get queued to be sent back to the server. I’ve given each tracking change it’s own function and grouped into relevant parts. Any preloading going on of paywalls/products/responses shouldn’t interfere with the active session because it (mostly) checks the IDs of the paywall that’s being preloaded first. As it’s sending off requests, it stores the last 20 sessions in memory which is then saved to disk when the app resigns active. When the app first opens up it checks to see if any of these are there and sends them off to the server and then clears the cache.
When the app session is changed, it automatically updates all pending and active sessions with the latest app session and sends these off to the server.
Things to look out for:
endAt
dates. For example, App Session has anendAt
date when a transaction occurs because the app leaves the foreground.The environment is reverted to the production environment - to test, you'll need to change that to dev.