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

What "context" should I use with ConnectivityStatus constructor on iOS? #5

Open
iRhythmTuan opened this issue Sep 28, 2022 · 4 comments

Comments

@iRhythmTuan
Copy link

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.

@ln-12
Copy link
Owner

ln-12 commented Sep 28, 2022

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.

@iRhythmTuan
Copy link
Author

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

@ln-12
Copy link
Owner

ln-12 commented Sep 29, 2022

Did you try to run my sample?

@morgan4080
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants