Skip to content

Some mandatory properties in RegistrationConfig typing should be optional #192

Description

@Brqqq

Report

Environment

  • Platforms: N/A (Development issue)
  • Android version: -
  • iOS version: -

Issues and Steps to Reproduce

In a TypeScript RN project, use this code

NotificationHub.registerTemplate({
        connectionString: "",
        hubName: "",
        senderID: "",
        template: "",
        templateName: "",
        tags: []
});

Expected Behavior

Describe what you expected would happen.
The above mentioned code should not trigger a TS error

Actual Behavior

Describe what actually happened. Include screenshots, if applicable.
A TS error is given

Argument of type '{ connectionString: string; hubName: string; senderID: string; template: string; templateName: string; }' is not assignable to parameter of type 'TemplateRegistrationConfig'.
Type '{ connectionString: string; hubName: string; senderID: string; template: string; templateName: string; }' is missing the following properties from type 'TemplateRegistrationConfig': channelName, channelImportance, channelShowBadge, channelEnableLights, channelEnableVibrationts(2345)

Here: https://github.com/CatalystCode/react-native-azurenotificationhub/blob/master/docs/android-installation.md it mentions that all these missing properties are optional. But the typing doesn't declare them as optional.

Link to Code

If you have some code that maintainers can clone/test for themselves, bugs can be resolved much faster. Please paste a link here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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