Commit 35ce218
authored
Fix for subscribe issue, on cold start always unsubscribed (#599)
* Fix for subscribe issue, on cold start always unsubscribed
* During previous refactoring for USerDefault keys an issue was caused with SUBSCRIPTION key
* Two essential checks (OneSignal.m and OSSubscription.m) were changed and should not have been
* When pausing in app messaging, this only prevented items from being added to the queue, instead of from showing
* Demo app changes
* Moved all UI property to ViewController.h interface so that the AppDelegate.m has access to them
* Added a subscribe segment control (like consent and pausing IAM) to demo app, connected subscription observer
* When subscription changes so does the segment control will also
* Made segment control selected switches green instead
* Fixed white text problem due to default in dark mode
* SDK changes
* Reverted change for the SUBSCRIPTION key to fix the always unsubscribed issue
* Using keyExists in OSSubscription.m now, replaces getSavedObjectForKey and objectForKey
* Reverted changes for saving SUBSCRIPTION status in OneSignal.m
* Moved the check for paused in app messaging so that queue items won't be shown now
* Fixing comments from previous commit in PR
* Additional clean-up (sorting and naming) to the OneSignalUserDefault keys
* Fixed a unit test after changing functionality of the pause IAM flag
* Continuously accumulate IAMs in the queue, but don't show any IAMs until IAMs are enabled again
* Fixing comments from previous commit in PR
* Changes in OneSignalCommonDefines for OneSignalUserDefault (NSUserDefaults) keys
* Now we add suffixes to keys with a to and from state ("_TO" or "_FROM")
* Organized and renamed any confusing or inconsistent keys
* String values need to be changed still, but we do not know of the affects here and should wait to do anything with the string values until we have a proper migration solution
* Removed 2 "saveForBoolKey" methods because they are not using the getter "getBoolForSavedKey" anywhere
* To be more specific, OSUD_PERMISSION_ACCEPTED_TO, OSUD_WAS_PROMPTED_FOR_NOTIFICATIONS_TO, OSUD_PROVISIONAL_PUSH_AUTHORIZATION_TO al;l are not used in any setters or getters for UserDefaults
* We may need these in the future and we currently use their FROM variants1 parent 26a4189 commit 35ce218
File tree
27 files changed
+403
-402
lines changed- iOS_SDK
- OneSignalDevApp/OneSignalDevApp
- Base.lproj
- OneSignalSDK
- Source
- UnitTests
- Shadows
27 files changed
+403
-402
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 106 | | |
114 | 107 | | |
115 | | - | |
116 | 108 | | |
117 | 109 | | |
118 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
119 | 117 | | |
120 | | - | |
121 | 118 | | |
122 | 119 | | |
123 | 120 | | |
| |||
Lines changed: 145 additions & 158 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
36 | 54 | | |
37 | 55 | | |
Lines changed: 15 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 34 | | |
56 | 35 | | |
57 | 36 | | |
| |||
60 | 39 | | |
61 | 40 | | |
62 | 41 | | |
63 | | - | |
| 42 | + | |
64 | 43 | | |
65 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
66 | 47 | | |
67 | 48 | | |
68 | 49 | | |
| |||
102 | 83 | | |
103 | 84 | | |
104 | 85 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 86 | + | |
| 87 | + | |
108 | 88 | | |
109 | 89 | | |
110 | 90 | | |
| |||
146 | 126 | | |
147 | 127 | | |
148 | 128 | | |
149 | | - | |
150 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
151 | 136 | | |
152 | 137 | | |
153 | 138 | | |
154 | | - | |
155 | | - | |
| 139 | + | |
| 140 | + | |
156 | 141 | | |
157 | 142 | | |
158 | 143 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
| |||
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| |||
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
133 | 131 | | |
134 | 132 | | |
135 | 133 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | 134 | | |
141 | 135 | | |
142 | 136 | | |
143 | 137 | | |
144 | 138 | | |
145 | 139 | | |
146 | 140 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
152 | 144 | | |
153 | 145 | | |
154 | 146 | | |
| |||
167 | 159 | | |
168 | 160 | | |
169 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
170 | 166 | | |
171 | 167 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | 168 | | |
176 | | - | |
177 | | - | |
| 169 | + | |
178 | 170 | | |
179 | | - | |
180 | 171 | | |
181 | 172 | | |
182 | | - | |
183 | 173 | | |
184 | 174 | | |
185 | | - | |
186 | 175 | | |
187 | 176 | | |
188 | 177 | | |
189 | 178 | | |
190 | 179 | | |
191 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
192 | 187 | | |
193 | 188 | | |
194 | 189 | | |
| |||
204 | 199 | | |
205 | 200 | | |
206 | 201 | | |
207 | | - | |
208 | 202 | | |
209 | 203 | | |
210 | 204 | | |
| |||
240 | 234 | | |
241 | 235 | | |
242 | 236 | | |
| 237 | + | |
243 | 238 | | |
244 | 239 | | |
245 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments