segmentio / analytics-ios

The hassle-free way to integrate analytics into any iOS application.
https://segment.com/libraries/ios
MIT License
402 stars 334 forks source link

Notification observer is not being called "io.segment.analytics.integration.did.start" #1058

Open asadkazmi-mset opened 11 months ago

asadkazmi-mset commented 11 months ago

Describe the bug I updated my segment analytics to the swift version from Obj-c using SPM. After updating I cannot find 'SEGAnalyticsIntegrationDidStart' in the scope, so after some research I found I should be using this string literal "io.segment.analytics.integration.did.start" But after using that my observer function is not being called, previously before migration it was called with this "SEGAnalyticsIntegrationDidStart" notification

notificationCenter.addObserver(self,
                                       selector: #selector(integrationDidStart(_:)),
                                       name: NSNotification.Name(rawValue: "io.segment.analytics.integration.did.start"),
                                       object: nil)

To Reproduce use the "io.segment.analytics.integration.did.start" as an observer and its callback will not be called as it suppose to be called

Expected behavior This selector function(integrationDidStart()) should call if I have added the observer("io.segment.analytics.integration.did.start") correctly.

Platform (please complete the following information):