Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
asadkazmi-mset opened this issue Jan 3, 2024 · 1 comment
Assignees
Labels

Comments

@asadkazmi-mset
Copy link

asadkazmi-mset commented Jan 3, 2024

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):

  • Library Version in use: 1.5.1
  • Platform being tested: iOS
  • Integrations in use: Segment analytics with desitination firebase, adjust, braze
@bsneed
Copy link
Contributor

bsneed commented Feb 12, 2024

Hi @asadkazmi-mset, that observer is part of analytics-ios, not analytics-swift. You can probably do something like this ...

DispatchQueue.someQueue.async {
    analytics.waitUntilStarted()
    // do something now that it has.
}

@bsneed bsneed closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants