Description:
Recently found OneSignal upgraded to 3.0, but where did OSHandleNotificationReceivedBlock & getPermissionSubscriptionState go? There's no mention of them in either the migration guide or the API changes - who wrote the changes? How could these significant things get missed? What should we do to process received silent pushes in 3.0? Couldn't find any way in the 3.0 API doc.
Environment
3.0, Cocoapods
Steps to Reproduce Issue:
Same here, I have upgrade OneSignal SDK to 3.0.0 after updating via pod install
I'm getting these error saying cannot find in scope.
here is the list :
kOSSettingsKeyInAppLaunchURL
OSNotificationDisplayType.notification
OneSignal.getPermissionSubscriptionState()
OSHandleInAppMessageActionClickBlock
there is no proper updated documentation on Onesignal board, How we suppose to write proper code for it?
No response from OneSignal for a month now lol, and I suggest you to revert to 2.x as I feel the 3.0 update is a joke. I'll probably move to other services or write my own.
Yeah, I just revert to 2.x. can you please let me if you found any work around to write services, it'll be helpful. Thanks.
I won't have time to do it in the near future, but plan to just do it on my
Vapor backend. You can look at its doc: https://docs.vapor.codes/4.0/apns/
On Sun, Jan 10, 2021 at 11:50 PM Pranjali Wagh notifications@github.com
wrote:
Yeah, I just revert to 2.x. can you please let me if you found any work
around to write services, it'll be helpful. Thanks.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/OneSignal/OneSignal-iOS-SDK/issues/839#issuecomment-757682657,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABGTZ2YJ4UTNPD7WOWFSEM3SZKUTRANCNFSM4VCGVRGQ
.
The same issue for me. There's nothing in the documentation about OSHandleNotificationReceivedBlock
@sprzenus you can use this OSNotificationOpenedBlock instead of OSHandleNotificationReceivedBlockthey have change the name of the method.
@sprzenus you can use this
OSNotificationOpenedBlockinstead ofOSHandleNotificationReceivedBlockthey have change the name of the method.
@pranjali420 As I read in the documentation OSNotificationOpenedBlock is a changed version of OSHandleNotificationActionBlock. I have to implement both OSHandleNotificationReceivedBlock and OSHandleNotificationActionBlock. Are they work the same way now? There's no mention in the documentation about it so I'm not sure.
@sprzenus Yes you are right OSNotificationOpenedBlock is a changed version of OSHandleNotificationActionBlock and for OSHandleNotificationReceivedBlock you need to use OSNotificationWillShowInForegroundBlock both working same way as before just in second method their is completion block you need to write according to it's response. Let me know if this is working.
@pranjali420 Sorry for late response, I have very little time to update dependencies on the project. For now I'm stuck with an error message that app_id isn't set. Actually, I don't know what's going on because I set the appID just after initWithLaunchOptions(_:). I think this may be old API of OneSignal which expects app_id in the header and doesn't handle appId header field... but it's only a speculation.
Hey @sprzenus how you are setting an appID I have see one example in OneSignal's source code example they have set it like this :
OneSignal.setAppId("3beb3078-e0f1-4629-af17-fde833b9f716")
OneSignal.initWithLaunchOptions(launchOptions)
OneSignal.setNotificationOpenedHandler(notificationOpenedBlock)
OneSignal.setNotificationWillShowInForegroundHandler(notifWillShowInForegroundHandler)
OneSignal.setAppSettings(onesignalInitSettings)
try this may be they have change the way for setting an appid, i'm also not sure about this, let me know if I can help you with anything.
@pranjali420 I don't know, what I've changed but it works now. Thanks for all your help!
How are new versions being released without getting this fixed?!
Hello, these changes have been clarified in the migration document. Please use
getDeviceState to receive subscription status information for all messaging channels on demand. To be notified of changes to the statuses use the following observers: OSPermissionObserver, OSSubscriptionObserver, OSEmailSubscriptionObserver, and OSSMSSubscriptionObserver.
The OSHandleNotificationReceivedBlock has been renamed to OSNotificationWillShowInForegroundBlock to clarify the behavior and match the UNUserNotificationCenterDelegate event name. This block can be set using the method setNotificationWillShowInForegroundHandler.