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

setConnected fully impelementation #491

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

ciakov
Copy link

@ciakov ciakov commented Aug 25, 2024

Globals setOffline function was mapping "false" parameter to null when calling setConnected.
Now it accepts bool? so
null is mapped to null
true is mapped to false
and false is mapped to true.
This has been done for Android implementation.
For iOS I didn't find any implementation.

Copy link

@Zverik Zverik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, apart from some syntactic issues.

boolean offline = methodCall.argument("offline");
ConnectivityReceiver.instance(context).setConnected(offline ? false : null);
Boolean offline = (Boolean) methodCall.argument("offline");
ConnectivityReceiver.instance(context).setConnected(offline!=null ? !(offline) : null);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use !offline.booleanValue() to make the conversion explicit. Also, please add spaces around !=.

@josxha josxha added this to the v0.21.0 milestone Oct 3, 2024
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

Successfully merging this pull request may close these issues.

3 participants