Closed
Description
Plugin
share_plus
Use case
Currently, the SharePlus
class entry point has three major problems:
- Functionality to share content is divided in three methods, this difficult implementing new features and leads to code duplication across these three.
- Share functions have parameter creep, as functionality grows and more optional/named parameters are added. It is not clear what are all parameters doing (e.g.
subject
) - The
SharePlus
class exposes static methods, and it is not instantiable, this makes mocking/faking more difficult.
Proposal
- Unify the three methods into one.
- Create a
ShareParams
class with multiple share parameters (this class should be serializable so it can be passed to the native layer as well), and document those parameters. - Make
SharePlus
instantiable and expose a singleton instance, so devs can choose how to use it. - Expose old static methods with
@deprecated
annotation, so public API remains the same.