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

Some methods require a parameter of type Java.Lang.Boolean instead of .NET Boolean in Firebase Crashlytics and Perf bindings #992

Open
Digifais opened this issue Oct 1, 2024 · 3 comments

Comments

@Digifais
Copy link

Digifais commented Oct 1, 2024

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

.NET 8.0.402

Description

There are two methods which I currently know of that require a parameter of type Java.Lang.Boolean rather than .NET Boolean.

In Xamarin.Firebase.Crashlytics v119.1.0, FirebaseCrashlytics.Instance.SetCrashlyticsCollectionEnabled expects a Java.Lang.Boolean? parameter while v119.0.3.1 had a .NET Boolean parameter.

FirebasePerformance.Instance.SetPerformanceCollectionEnabled of Xamarin.Firebase.Perf has the same issue as well where it expects a Java.Lang.Boolean instead of a .NET Boolean type, but this has been like this for quite a while.

Steps to Reproduce

  1. Add Xamarin.Firebase.Crashlytics v119.1.0 or Xamarin.Firebase.Perf v121.0.0
  2. Call the above mentioned methods in Description
  3. See that they require a parameter of type Java.Lang.Boolean instead of a .NET Boolean

Did you find any workaround?

Use Java.Lang.Boolean.ValueOf()

Relevant log output

No response

@Digifais Digifais changed the title Some methods require a parameter of type Java.Lang.Boolean instead of .NET Boolean in Firebase bindings Some methods require a parameter of type Java.Lang.Boolean instead of .NET Boolean in Firebase Crashlytics and Perf bindings Oct 1, 2024
@moljac
Copy link
Contributor

moljac commented Oct 1, 2024

Thanks for the feedback.

Some investigation is needed in order to give correct answer.

@jonpryor
Copy link
Member

jonpryor commented Oct 1, 2024

The parameter type is Java.Lang.Boolean? because the Java API takes a java.lang.Boolean:

Consider FirebaseCrashlytics#setCrashlyticsCollectionEnabled(java.lang.Boolean).

Additionally, note the documentation for that method, which explicitly calls out null as a value:

whether to enable or disable automatic data collection. When set tofalse, the new value does not apply until the next run of the app. When set to null, the override is cleared and automatic data collection settings are determined by the configuration in your AndroidManifest.xml or other Firebase-wide settings.

We're not special-casing anything here. We're just binding the API, as-is.

@Digifais
Copy link
Author

Digifais commented Oct 1, 2024

The parameter type is Java.Lang.Boolean? because the Java API takes a java.lang.Boolean:

Consider FirebaseCrashlytics#setCrashlyticsCollectionEnabled(java.lang.Boolean).

Additionally, note the documentation for that method, which explicitly calls out null as a value:

whether to enable or disable automatic data collection. When set tofalse, the new value does not apply until the next run of the app. When set to null, the override is cleared and automatic data collection settings are determined by the configuration in your AndroidManifest.xml or other Firebase-wide settings.

We're not special-casing anything here. We're just binding the API, as-is.

Thanks for the clear response!

@Digifais Digifais closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2024
@Digifais Digifais reopened this Oct 1, 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

No branches or pull requests

3 participants