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

HubChannel - How to define their own channels for intra-app communication. #1738

Open
1 task done
kzhang-dsg opened this issue May 14, 2022 · 1 comment
Open
1 task done
Labels
core Amplify Core library feature-request Request a new feature improvement Any improvement that's not a bug and not requesting new functionality

Comments

@kzhang-dsg
Copy link

kzhang-dsg commented May 14, 2022

Before opening, please confirm:

Language and Async Model

Java

Amplify Categories

Not applicable

Gradle script dependencies

// Put output below this line

    // Amplify core dependency
    implementation 'com.amplifyframework:core:1.35.2'

    // Support for Java 8 features
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

    // Amplify analytics
    implementation 'com.amplifyframework:aws-analytics-pinpoint:1.35.2'
    implementation 'com.amplifyframework:aws-auth-cognito:1.35.2'

    // Amplify auth (Cognito)
    implementation 'com.amplifyframework:aws-auth-cognito:1.35.2'

Environment information

# Put output below this line
------------------------------------------------------------
Gradle 7.2
------------------------------------------------------------

Build time:   2021-08-17 09:59:03 UTC
Revision:     a773786b58bb28710e3dc96c4d1a7063628952ad

Kotlin:       1.5.21
Groovy:       3.0.8
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          1.8.0_275 (AdoptOpenJDK 25.275-b01)
OS:           Linux 5.4.0-109-generic amd64

Please include any relevant guides or documentation you're referencing

No response

Describe the feature request

In the HubChannel class, it said "Apps can define their own channels for intra-app communication.":

/**
 * HubChannel represents the channels on which Amplify category messages will be dispatched.
 * Apps can define their own channels for intra-app communication. Internally, Amplify uses the Hub
 * for dispatching notifications about events associated with different categories.
 */
public enum HubChannel {

But in the HubCategory.subscribe(@nonnull HubChannel hubChannel, @nonnull HubSubscriber hubSubscriber) method, the method only accepts the HubChannel enum. Which means we can not extend and define custom channels.

Could you please change the HubChannel to an interface instead of enum to make it extandable?

Initialization steps (if applicable)

No response

Code Snippet

// Put your code below this line.

amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@eeatonaws eeatonaws added improvement Any improvement that's not a bug and not requesting new functionality core Amplify Core library labels May 16, 2022
@ankpshah
Copy link
Contributor

ankpshah commented Feb 5, 2024

Hello thank you for creating the issue, someone from our team will get back on this.

@phantumcode phantumcode added the feature-request Request a new feature label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Amplify Core library feature-request Request a new feature improvement Any improvement that's not a bug and not requesting new functionality
Projects
None yet
Development

No branches or pull requests

4 participants