Iterable / swift-sdk

Iterable's iOS SDK. Receive and track pushes to Iterable from your iOS app.
https://iterable.com/
MIT License
86 stars 68 forks source link

[MOB-?] Fix InAppMessage not being displayed due to correct KeyWindow not being retrieved on app that uses multiple windows #740

Open harrywombat opened 5 months ago

harrywombat commented 5 months ago

🔹 Jira Ticket(s)

✏️ Description

If a project makes use of multiple Windows, then the IterableSDK can fail to retrieve the correct one, resulting in the InAppMessage failing and never being displayed.

This fix allows the currently displayed Window to be retrieved (the true keyWindow), so the InAppMessage can be displayed on the very top view controller.

It also accounts for the iOS 15 changes to windows.

Notes:

I have only tested it on my company's app which uses multiple windows, I haven't tested it on a single window app.

jena-chakour commented 5 months ago

Thanks for sharing this, Harry!