zoho / SalesIQ-Mobilisten-iOS

Your mobile app's ideal live chat partner. Power up your iOS App with the SalesIQ Mobilisten iOS SDK.
https://mobilisten.io
11 stars 4 forks source link

Issue: kReachabilityChangedNotification ambiguous #19

Closed benv33 closed 2 years ago

benv33 commented 3 years ago

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

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

Rishabh-Raghunath commented 3 years ago

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 commented 2 years ago

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.