Skip to content

Commit 2fe55b3

Browse files
committed
Create the push sub model with a notification type
- Create the push sub model with the notification_types at time of creation - This is so that on the first app open, we can receive push prompt IAMs (server expects to have an appropriate notification_type to determine eligibility)
1 parent b7f070c commit 2fe55b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSSubscriptionModel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class OSSubscriptionModel: OSModel {
262262
_reachable = reachable
263263
_isDisabled = isDisabled
264264

265-
// Set test_type if subscription model is PUSH
265+
// Set test_type if subscription model is PUSH, and update notificationTypes
266266
if type == .push {
267267
let releaseMode: OSUIApplicationReleaseMode = OneSignalMobileProvision.releaseMode()
268268
// Workaround to unsure how to extract the Int value in 1 step...
@@ -275,6 +275,7 @@ class OSSubscriptionModel: OSModel {
275275
if releaseMode == .UIApplicationReleaseWildcard {
276276
self.testType = OSUIApplicationReleaseMode.UIApplicationReleaseWildcard.rawValue
277277
}
278+
notificationTypes = Int(OSNotificationsManager.getNotificationTypes(_isDisabled))
278279
}
279280

280281
super.init(changeNotifier: changeNotifier)

0 commit comments

Comments
 (0)