You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a common case where updates (such as optedIn) should
still propagate even if we haven't sent the POST /users create
call yet. Motivation for this test was a bug was discovered
where calling OneSignal.User.pushSubscription.optIn() was not
prompting for notification permission if it was called before
the create User network call finished.
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/subscriptions/impl/SubscriptionManager.kt
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -157,7 +157,10 @@ internal class SubscriptionManager(
157
157
args:ModelChangedArgs,
158
158
tag:String,
159
159
) {
160
-
val subscription = subscriptions.collection.firstOrNull { it.id == args.model.id }
160
+
val subscription =
161
+
subscriptions.collection.firstOrNull {
162
+
args.model == (it asSubscription).model
163
+
}
161
164
162
165
if (subscription ==null) {
163
166
// this shouldn't happen, but create a new subscription if a model was updated and we
0 commit comments