Skip to content

Commit

Permalink
Save push subscription ID on app start
Browse files Browse the repository at this point in the history
Because of a bug prior to v5.0.5, players that upgraded from v3 -> v5 were missing the player ID in cache for sending to notification opened and notification received endpoints.
Now, every time app cold starts, as part of the push subscription model checking itself for updates, we will cache its subscription ID if non-empty.
  • Loading branch information
nan-li committed Dec 1, 2023
1 parent 7ec4d9c commit eb049f4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ extension OSSubscriptionModel {
netType = OSNetworkingUtils.getNetType() as? Int
// sdkType ??
// isRooted ??
if type == .push && !(subscriptionId ?? "").isEmpty {
OneSignalUserDefaults.initShared().saveString(forKey: OSUD_PUSH_SUBSCRIPTION_ID, withValue: subscriptionId)
}
}

enum OSPushPropertyChanged {
Expand Down

0 comments on commit eb049f4

Please sign in to comment.