multiplatform-connectivity-status
multiplatform-connectivity-status copied to clipboard
What "context" should I use with ConnectivityStatus constructor on iOS?
I am trying to integrate the latest version 1.3.0 and run into the following error:
"Expected class ConnectivityStatus does not have default constructor"
Looks like ConnectivityStatus is now expecting an instance of "Context" class. How I create this context instance for iOS app? I looked at the sample app for iOS and noticed that ConnectivityStatus() also doesn't pass any parameter. Is the sample app updated to work with version 1.3.0? Can you update it if it's not? Thanks.
The sample works fine for me with version 1.3.0.
Please not that you cannot use the ConnectivityStatus
class from your common module. As the sample shows, you have to define you own wrapper. That's because (as you already discovered) Android needs a context while iOS does not.
So in your common code you have to define a expect class which is implemented for iOS and Android:
Please check that you are not using ConnectivityStatus
from you common module. If the error still remains, please upload a minimal example of your code.
Thanks, I am able to compile on Android side now. However, when I've tried to compile it on iOS, I ran into the following error:
Undefined symbols for architecture x86_64: "OBJC_CLASS$_Reachability", referenced from: objc-class-ref in result.o ld: symbol(s) not found for architecture x86_64
I have properly import Reachability framework using pod.
How do I resolve this error?
Thanks
Did you try to run my sample?
Thanks, I am able to compile on Android side now. However, when I've tried to compile it on iOS, I ran into the following error:
Undefined symbols for architecture x86_64: "OBJC_CLASS$_Reachability", referenced from: objc-class-ref in result.o ld: symbol(s) not found for architecture x86_64
I have properly import Reachability framework using pod.
How do I resolve this error?
Thanks
Was anyone able to get past this?