klaviyo / klaviyo-swift-sdk

Swift SDK for integrating Klaviyo’s push notifications, event tracking, and user profile management into iOS applications.
https://www.klaviyo.com/mobile-push-marketing
MIT License
12 stars 11 forks source link

Fixed opened push not getting called when app is terminated #145

Closed ajaysubra closed 8 months ago

ajaysubra commented 8 months ago

Description

We were handling pending requests but when an app is terminated and launched again from a push notification open it triggers the open event and this open event is added to the pending requests since the SDK is not yet initialized (when the app is relaunched after terminating it's initialized again). However, between the SDK going from initializing to initialized the requests that were added to pending requests were ignored which is what was causing the opened push events from not getting enqueued and eventually sent out.

The fix was to just use the pending requests from state and enqueue each of those instead of using the state that was taken from the disk.

Check List

Manual Test Plan

1.

Supporting Materials