OneSignal / OneSignal-iOS-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
493 stars 262 forks source link

[Feat] Combine user property updates for network call improvements, fix purchase bug #1444

Closed nan-li closed 3 months ago

nan-li commented 4 months ago

Description

One Line Summary

Combine user property updates for network call improvements by combining these updates into one request, and fix a purchase tracking bug.

Details

This PR is best read commit by commit

  1. Session time, count, purchases - these changes are not model driven and now enqueue as a Delta whereas they used to be turned into Request objects immediately
  2. Updated attributed and unattributed time processors to send the session time using the changes above. They will not manage their own background tasks when the app is backgrounding. They will not manage the storage of the user's session time once that time is sent to the User module to handle (except for outcomes which is separate of the user).
  3. Introduce an enum OSPropertiesSupportedProperty, that restricts the properties we allow for updating a user.
  4. Actual changes to combine User Update Deltas into one request
  5. Fix a bug in purchase tracking where a number is sent when the server expects a string (amount).
  6. Update existing tests after the above changes and add tests.

Motivation

Reduce server load.

Scope

Testing

Unit testing

Manual testing

Physical iPhone 13 on iOS 17.4

Tested session ending influences, both attributed and unattributed

Tested adding tags, purchases, and backgrounding app to get session time

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable