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
Consider making push an optional plugin #292
Comments
I have a theoretical idea on how we can solve this issue. Considering we act as a broker between push provider and customer, we want to implement a generic interface as a separate package that will act as AblyPushReceiver so that we can implement custom receivers for later. Custom receivers themselves will reside into a separate package but will be using the common package as dependency to access AblyPushReceiver interface. On the ably side we can also import that common package and interact with Ably system through that (eg. push activation, deactivation, message receive etc). We can write our default receiver and provide it as an optional package. The aim is to give the customers the ability to choose receiver of their liking. However in cases where users not choosing a default receiver, we cannot process messages through our own receiver. In such cases we could inform users that our message brokership is not active anymore. But we can recommend them to delegate their messages through our common interface if they want Ably capabilities with push system. Some notes worth to take in such case,
|
It maybe worth to experiment with the idea in a small project to verify / explore technical capabilities.
|
@ikbalkaya, @KacperKluka, @AndyNicks and myself had a call this morning around this issue. In terms of the current interfaces between the application developer's code and our current plugin API, it sounds like the approach diagramed above will not change that (i.e. it will not remove or mutate existing My only concern is that we need to be careful about the developer experience with any change we make to adopt this new design. Even asking the app developer to add something to their code to explicitly specify our default-yet-optional push provider means that they will have two touch points to make it work: (1) Add dependency; (2) Instantiate in code and provide to core Ably implementation via a method call or property set. -- Can we avoid that? Could we follow an approach similar to SLF4J, perhaps, where the default is 'no-operation' unless a compatible plugin is added to the project, in which case that plugin (the 'Default Push Provider') kicks into action? Relates to #118. |
I think we can minimise work done from developers' side provided we are clear on developer documentation. However I don't think we can (or we should) include default or non-default push providers without user including in their dependencies and declare the intention to use it. That shouldn't cause so much trouble as we will ask them to explicitly add a compatible plugin to their project and declare their intention to use it. In fact I think this will make the contract between us and customers clear and prevent potential confusion caused from Ably working with push notifications.. |
I will try to create a simple PoC to see whether we can proceed with this approach. I will try to use endorsed / non-endorsed plugin approaches and see how they work |
I thought below higher level concepts might help with verifying the effectiveness of such a design.
|
I created a repository to write a POC for this case https://github.com/ikbalkaya/PushInterfacePOC |
I was able to create a simple proof of concept that makes it possible to use our plugin with one or more push providers |
Closing this for now. The next step will be to actually implement this in our library. |
h3. Problem
We are facing with some functional issues which are related to our push notification implementation. We are also facing compatibility issues when another library is used alongside with ours. See #226
We have two main issues
We install our custom implementations to apps which uses our library. For example we declare services, broadcast receivers to Android apps and users unless they opt out in their manifest files. This situation creates a conflict described #226 and presents some inflexibility to users' side.
We are not using (or unable to use) popular library to lessen our burden dealing with internals of push notifications. This path was followed as this library would also expose iOS plugin too, but we do not want to support Firebase's iOS plugin.
Some thoughts on how we can address these problems
To be discussed...
The text was updated successfully, but these errors were encountered: