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
I can't access subscriptionId , I want to use rest api in my app but I need subscriptionId for specific notification. I tried with copy subs id one signal panel thats runned not have a problem in my code, but inside the code not access have a directly subs id.
Steps to reproduce?
iOS Version 15-18
OneSignal Version 5.2.1
AppDelegate -> didFinishLaunchingWithOptions
OneSignal.initialize(Resources.OneSignalID, withLaunchOptions: launchOptions)
OneSignal.Notifications.requestPermission { accepted in
print("User accepted notifications: \(accepted)")
print(OneSignal.User.pushSubscription.id)
}
What did you expect to happen?
Easily access subs id
OneSignal iOS SDK version
5.2.1
iOS version
17, 16, 15
Specific iOS version
No response
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hi @YurchukV thanks for reaching out with your question.
If you are getting OneSignal.User.pushSubscription.id too early on a new app install, it will be null until the subscription ID is receieved from the OneSignal servers.
You can use the Push Subscription Observer to be notified of changes to the push subscription, including when the ID is received.
What happened?
I can't access subscriptionId , I want to use rest api in my app but I need subscriptionId for specific notification. I tried with copy subs id one signal panel thats runned not have a problem in my code, but inside the code not access have a directly subs id.
Steps to reproduce?
iOS Version 15-18 OneSignal Version 5.2.1 AppDelegate -> didFinishLaunchingWithOptions OneSignal.initialize(Resources.OneSignalID, withLaunchOptions: launchOptions) OneSignal.Notifications.requestPermission { accepted in print("User accepted notifications: \(accepted)") print(OneSignal.User.pushSubscription.id) }
What did you expect to happen?
Easily access subs id
OneSignal iOS SDK version
5.2.1
iOS version
17, 16, 15
Specific iOS version
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: