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

Issue: kReachabilityChangedNotification ambiguous #19

Closed
benv33 opened this issue Sep 13, 2021 · 2 comments
Closed

Issue: kReachabilityChangedNotification ambiguous #19

benv33 opened this issue Sep 13, 2021 · 2 comments
Assignees
Labels
bug Something isn't working confirmed The bug/feature request has been confirmed fix rolled-out This issue has been addressed in our backend

Comments

@benv33
Copy link

benv33 commented Sep 13, 2021

Describe the bug
A clear and concise description of what the bug is.
When trying to compile my app I get :
Reference to 'kReachabilityChangedNotification' is ambiguous

To Reproduce
Steps to reproduce the behavior:

  1. Create an app
  2. Add pod 'Mobilisten' and pod 'Reachability' to pod file
  3. Add headers for both project in a file and reference kReachabilityChangedNotification
  4. Build fails with Reference to 'kReachabilityChangedNotification' is ambiguous

Expected behavior
A clear and concise description of what you expected to happen.
The app should compile without error

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Do you usually run the project on the simulator or a physical device?
  • Device: Simulator iPhone 12 Pro Max
  • OS: iOS 14.5
  • Xcode Version: 12.5.1
  • Mobilisten Version: 4.1.0

Additional context
Add any other context about the problem here.
The constant kReachabilityChangedNotification is defined in Reachability and Mobilisten library

@benv33 benv33 added bug Something isn't working pending confirmation The bug/feature request is pending confirmation labels Sep 13, 2021
@Rishabh-Raghunath Rishabh-Raghunath self-assigned this Sep 13, 2021
@Rishabh-Raghunath
Copy link
Member

Hi @benv33, thanks for bringing this conflict between the Mobilisten and the Reachability pods to our notice.

NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification";

Since kReachabilityChangedNotification is just a String, an easy workaround would be to add an observer using the same raw value.
Here's a quick example in Swift that would work.

extension Notification.Name {
    static let reachabilityChanged = Notification.Name("kReachabilityChangedNotification")
}

// Adding an observer for the reachability changed notification.
NotificationCenter.default.addObserver(self, selector: #selector(self.reachabilityChanged(notification:)), name: .reachabilityChanged, object: nil)

We'll definitely have this addressed through an update to the Mobilisten pod. Until then, you may use the above snippet to add an observer.

@Rishabh-Raghunath Rishabh-Raghunath added confirmed The bug/feature request has been confirmed and removed pending confirmation The bug/feature request is pending confirmation labels Sep 13, 2021
@Rishabh-Raghunath
Copy link
Member

Hi @benv33, this issue has been addressed in Mobilisten 4.2.0.
Please update Mobilisten to the latest version using Cocoapods by running the pod update Mobilisten command from the project directory.

Once again, thanks for bringing this issue to our notice.

@Rishabh-Raghunath Rishabh-Raghunath added the fix rolled-out This issue has been addressed in our backend label Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed The bug/feature request has been confirmed fix rolled-out This issue has been addressed in our backend
Projects
None yet
Development

No branches or pull requests

2 participants