Skip to content

is_first_launch type is "true" | "false" but returns boolean on Android (v6.17.5) #690

Description

@yugun-ilevit-com

Report

Plugin Version

6.17.5

On what Platform are you having the issue?

Android

What did you do?

The ConversionData type in index.d.ts declares is_first_launch as a string literal union:

// index.d.ts
export type ConversionData = {
  ...
  data: {
    is_first_launch: "true" | "false";
    ...
  };
};

Following the type, our onInstallConversionData handler compared it as a string:

if (res.data.is_first_launch !== 'true') return

What did you expect to happen?

res.data.is_first_launch to be the string "true" on Android, as declared by the type (and as stated in the docs).

What happened instead?

On a physical Android device (Samsung Galaxy S21, SM-G991N), res.data.is_first_launch came back as a boolean true, not the string "true". So res.data.is_first_launch !== 'true' was always true and the first-launch branch never ran. We had to widen the check:

if (res.data.is_first_launch !== 'true' && (res.data.is_first_launch as any) !== true) return

Please provide any other relevant information.

This is doubly surprising because the docs (Docs/RN_API.md) state the opposite of what we observed:

Note: is_first_launch will be "true" (string) on Android and true (boolean) on iOS.

But we observed a boolean on Android. So in practice the value can be either a boolean or a string regardless of platform, and the TypeScript type "true" | "false" is incorrect — it should at least include the boolean form:

is_first_launch: boolean | "true" | "false";

Related prior reports: #257 (closed as "won't fix"), #122. The type is still "true" | "false" in 6.17.5, so re-filing against the current version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions