Commit a51d7f7
committed
fix: Retry IAM fetch when OneSignal ID becomes available
When getInAppMessagesFromServer is called early in the app lifecycle while users are changing (e.g., login is called after initialize), the OneSignal ID may not be available yet, causing the fetch to fail silently. This fix ensures in-app messages are eventually fetched by:
- Adding OSUserStateObserver to OSMessagingController
- Storing the subscription ID when fetch fails due to missing OneSignal ID
- Retrying the fetch when user state changes and OneSignal ID becomes available
This prevents in-app messages from never being fetched when users are identified early in the app startup lifecycle.1 parent f731bc5 commit a51d7f7
2 files changed
Lines changed: 17 additions & 2 deletions
File tree
- iOS_SDK/OneSignalSDK/OneSignalInAppMessages/Controller
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
| 181 | + | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
| |||
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
| 261 | + | |
257 | 262 | | |
258 | | - | |
| 263 | + | |
| 264 | + | |
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
| |||
1198 | 1204 | | |
1199 | 1205 | | |
1200 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
1201 | 1216 | | |
1202 | 1217 | | |
1203 | 1218 | | |
| |||
0 commit comments