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

Way to check programatically if a library supports receiving push #72

Open
tcard opened this issue Nov 2, 2017 · 2 comments
Open

Way to check programatically if a library supports receiving push #72

tcard opened this issue Nov 2, 2017 · 2 comments

Comments

@tcard
Copy link
Contributor

tcard commented Nov 2, 2017

Right now, in iOS and Java, the library will compile differently in each case, so it's a compile time error to use the push-receiving methods if on OS X or non-Android Java. But we could have a method/constant/something to determine it programatically at runtime, specially given we're adding push-receiving support for browsers (JS).

My proposal would be rest.push.canActivate() -> Bool. If it returns true, then the rest.push.activate method exists.

Alternative names: canReceive, canRegister. The former might be misleading since maybe it can't receive for case-specific reasons even if the platform is able to (e. g. the user didn't give permission); the latter is more precise but it lacks consistency with the activate method.

┆Issue is synchronized with this Jira Task by Unito

@paddybyers
Copy link
Member

Why not have an API that can be queried even on library versions that predate the feature being defined?

eg Ably.hasFeature('push.activate')

@QuintinWillison QuintinWillison transferred this issue from ably/docs Oct 3, 2022
@sync-by-unito
Copy link

sync-by-unito bot commented Oct 17, 2022

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-2817

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

No branches or pull requests

2 participants