Skip to content
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

v3.4.0 #174

Merged
merged 54 commits into from
Sep 19, 2023
Merged

v3.4.0 #174

merged 54 commits into from
Sep 19, 2023

Conversation

yusuftor
Copy link
Collaborator

@yusuftor yusuftor commented Sep 15, 2023

Changes in this pull request

Enhancements

  • Adds sdk_version, sdk_version_padded, app_build_string, and app_build_string_number to the device object for use in rules. sdk_version is the version of the sdk, e.g. 3.4.0. sdk_version_padded is the sdk version padded with zeros for use with string comparison. For example 003.004.000. app_build_string is the build of your app and app_build_string_number is the build of your app casted as an Int.
  • When you experience no_rule_match, the TriggerFire event params will specify which part of the rules didn't match in the format "unmatched_rule_<id>": "<outcome>". Where outcome will either be OCCURRENCE, referring to the limit applied to a rule, or EXPRESSION. The id is the experiment id.
  • Adds a touches_began implicit trigger. By adding the touches_began event to a campaign, you can show a paywall the first time a user touches anywhere in your app.
  • Adds the ability to include a close button on a survey.
  • If running in sandbox, the duration of a free trial notification added to a paywall will be converted from days to minutes for testing purposes.
  • Adds the ability to show a survey after purchasing a product.

Fixes

  • Fixes issue where a survey attached to a paywall wouldn't show if you were also using the paywall_decline trigger.
  • Fixes issue where verification was happening after the finishing of transactions when not using a PurchaseController.
  • Fixes issue where the retrieved StoreTransaction associated with the purchased product may be nil.
  • Fixes issue where a presentationRequest wasn't being tracked for implicit triggers like session_start when there was no internet.

Checklist

  • All unit and UI tests pass. Demo project builds and runs.
  • I added tests, an experiment, or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.
  • I have run swiftlint in the main directory and fixed any issues.
  • I have updated the SDK documentation as well as the online docs.
  • I have reviewed the contributing guide

- Created an InternalPurchaseController. This coordinates the purchasing between provided purchase controllers and the internal purchasing mechanism.
- Removed StoreKitCoordinator and removed redundant files like PurchaseManager.
- Verification now happens before finishing a product.
- No longer checks for restored product after purchase. This means if someone repurchases a product they already have, it'll count as a transaction_complete. This shouldn't be happening anyway, but something to consider.
- Stops ASN1 files from being public/open.
- Fixes tests
…se-controller

Feature/add internal purchase controller
…ule-match

Feature/add context to no rule match
…-with-survey

feature/fix-paywall-decline-with-survey
Removes semaphore from UIWindow because all UIWindow events will be performed in serial as they're on the main actor.
…on-complete

feature/survey-on-transaction-complete
- Stores every purchased transaction by product if the transaction date of the purchased transaction is greater than the last stored transaction. Then when getting the latest transaction it defaults to SK2 and checks it has a transaction date within the last hour. If that fails, then it gets the lastInternalTransaction, i.e. the transaction that caused the internal purchase controller to mark the transaction as purchased. Otherwise, we fallback to getting the last transaction whose date is within the last hour. If that fails, we wait 500ms before trying again and finally returning nil.
- When completing a purchase, a check is added that the productId of the purchase is the one being purchased. Also checks that the date of the purchase is within the last hour to stop old purchases from completing the purchase.
- Fixes tests and swiftlint
Fixes issue where transactions other than purchased wouldn't call the completion block.
Added a few protocols to cover UNUserNotificationCenter testing.
@yusuftor yusuftor merged commit c920dc0 into master Sep 19, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant