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

Android null result #427

Closed
wants to merge 2 commits into from

Conversation

MaximBelov
Copy link
Contributor

@MaximBelov MaximBelov commented Apr 19, 2024

What do these changes do?

Standardise null result on android and ios

Why are these changes necessary?

Should return a "null" result on Android instead of "OK"
android – AirshipCordova kt  AirshipCordova app main  2024-04-19 16-04-55

How did you verify these changes?

Run demo app

Verification Screenshots:

android – AirshipCordova kt  AirshipCordova app main  2024-04-19 16-07-01

iPhone
android – AirshipCordova kt  AirshipCordova app main  2024-04-19 16-07-01

Anything else a reviewer should know?

@MaximBelov MaximBelov requested a review from a team as a code owner April 19, 2024 13:19
@@ -396,7 +396,7 @@ internal fun JsonSerializable.pluginResult(): PluginResult {
val json = this.toJsonValue()

return when {
json.isNull -> PluginResult(PluginResult.Status.OK)
json.isNull -> PluginResult(PluginResult.Status.OK, json.string)
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of json.string should it just be null ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

null is not supported by cordova
Screenshot 2024-04-19 at 17 34 42

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, this is literally passing "null"

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, an empty string is fine too

Copy link
Contributor

Choose a reason for hiding this comment

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

I am sure your change is good but let me double check the difference between iOS and Android

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Here is the obj-c one where instead of the message from the status its just nil. I doubt cordova will change now but this should be an upstream bug IMO - https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Public/CDVPluginResult.m#L115

@rlepinski
Copy link
Contributor

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.

2 participants