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

Request for Enhanced Control over Firebase Cloud Messaging Topic Subscription/Unsubscription Retry Mechanism. #6388

Open
ArcticFoxPro opened this issue Oct 17, 2024 · 0 comments
Labels

Comments

@ArcticFoxPro
Copy link

ArcticFoxPro commented Oct 17, 2024

What feature would you like to see?

When I was using the subscribeToTopic() and unsubscribeFromTopic() APIs of Firebase Cloud Messaging, I found that when the device cannot access the Google server, the relevant APIs will be retried indefinitely, and the developer cannot control and close the Firebase subscription process through threads such as the lifecycle.

I hope to leave the relevant retry operations to the developer, such as launching an API that "only attempts to subscribe once", so that the developer can receive an error callback and decide whether to retry after an error; or launching an API with a time parameter (for example, passing in 5000L means that if the retry fails after 5 seconds, the process will be closed and the error will be called back).

How would you use it?

The following is for reference only and does not mean that I require Firebase to implement the following APIs

  • subscribeToTopicWithTimeout(topic, timeoutMillis) / unsubscribeToTopicWithTimeout(topic, timeoutMillis)
    Indicates that the subscription operation is allowed to be retried within a given time. After the time exceeds the limit, the subscription is terminated and an error is callbacked.
  • subscribeToTopicOnce(topic) / unsubscribeToTopicOnce(topic)
    It means that it will be executed only once, whether it succeeds or fails, and a callback will be made to check whether it succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants