freestar-archive / freestarcapital-freestar_flutter_plugin

Other
4 stars 2 forks source link

Compatibility problem with connectivity_plus 1.0.6 plugin on iOS #1

Open alien190 opened 2 years ago

alien190 commented 2 years ago
ltrubov commented 2 years ago

This is caused by a namespace conflict between the Vungle SDK and the Reachability Cocoapod used by the connectivity_plus plugin. Because the Reachability pod is distributed as source, it can be fixed by editing the Pods/Reachability/Reachability.m file in the generated iOS app.

Replace the following line: NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification";

With something like: NSString *const kMY_COMPANY_NAMEReachabilityChangedNotification = @"kReachabilityChangedNotification";

Don’t change the actual value of the string, just the constant name. Then edit the one use of it further down the file:

dispatch_async(dispatch_get_main_queue(), ^{
        [[NSNotificationCenter defaultCenter] postNotificationName:kMY_COMPANY_NAMEReachabilityChangedNotification 
                                                            object:self];
    });

Save the file, and the app should build.

alien190 commented 2 years ago

Hello, @ltrubov

Thanks for your reply and proposed solution.

Could you please correct me if I mistake: 1) This solution will work only on my workstation. For example, if another developer pulls an application repo, the problem will occur once again. 2) If pods are updated after implementation of this solution, the problem will occur because Pods/Reachability/Reachability.m will be rewritten.

Thank you.