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 mandatory properties in RegistrationConfig typing should be optional #192

Open
1 task done
Brqqq opened this issue May 14, 2021 · 0 comments
Open
1 task done

Comments

@Brqqq
Copy link

Brqqq commented May 14, 2021

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.

Brqqq added a commit to Brqqq/react-native-azurenotificationhub that referenced this issue May 14, 2021
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

1 participant