-
Notifications
You must be signed in to change notification settings - Fork 125
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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 !=
.
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.