Commit 85bdd8a
committed
Detect for timezone changes and update the user
* Unless users switch via logging in and out, we never update timezone (as it is only sent in the Create User request).
* Now, we cache timezone ID and detect for changes on cold starts and update the user when it changes.
* We also fix a rare issue that comes from upgrading from an old version of player model to user model. When we have a legacy player ID, we fetch its identity rather than creating a user. Thus, in some rare cases, this old player is already missing a timezone, and the SDK never calls Create User to set a timezone. As a result, this user will be missing timezone.
* As a one-time migration, we send up the timezone for all users without considering if timezone is indeed missing or not. Note that this update will be combined in the payload of the session_count update. This update is driven by reading the timezone_id from cache, but before this PR, timezone was never cached, so it will return null.1 parent a1eea2b commit 85bdd8a
File tree
4 files changed
+35
-2
lines changed- iOS_SDK/OneSignalSDK/OneSignalUser/Source
- Support
4 files changed
+35
-2
lines changedLines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| 108 | + | |
100 | 109 | | |
101 | 110 | | |
102 | 111 | | |
| |||
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
297 | 309 | | |
298 | 310 | | |
299 | 311 | | |
| |||
567 | 579 | | |
568 | 580 | | |
569 | 581 | | |
| 582 | + | |
570 | 583 | | |
571 | 584 | | |
572 | 585 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments