Class DefaultRuntimeArgsService
- java.lang.Object
-
- com.gluonhq.attach.runtimeargs.impl.DefaultRuntimeArgsService
-
- All Implemented Interfaces:
RuntimeArgsService
- Direct Known Subclasses:
AndroidRuntimeArgsService
,DesktopRuntimeArgsService
,IOSRuntimeArgsService
public class DefaultRuntimeArgsService extends java.lang.Object implements RuntimeArgsService
-
-
Field Summary
-
Fields inherited from interface com.gluonhq.attach.runtimeargs.RuntimeArgsService
LAUNCH_LOCAL_NOTIFICATION_KEY, LAUNCH_PUSH_NOTIFICATION_KEY, LAUNCH_URL_KEY
-
-
Constructor Summary
Constructors Constructor Description DefaultRuntimeArgsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(java.lang.String key, java.util.function.Consumer<java.lang.String> consumer)
Adds a listener to the given key, likeRuntimeArgsService.LAUNCH_LOCAL_NOTIFICATION_KEY
orRuntimeArgsService.LAUNCH_URL_KEY
, so if those occur, the consumer will accept the provided Stringvoid
fire(java.lang.String key, java.lang.String value)
When the app is launched externally, this method is called to identify the key based on the service that is responsible, and the value associated to this key.void
removeListener(java.lang.String key)
Removes the listener for the given key
-
-
-
Method Detail
-
fire
public void fire(java.lang.String key, java.lang.String value)
Description copied from interface:RuntimeArgsService
When the app is launched externally, this method is called to identify the key based on the service that is responsible, and the value associated to this key. Typically the developer won't need to call this method for certain services that will launch the app from a Local Notifications or a custom URL.- Specified by:
fire
in interfaceRuntimeArgsService
- Parameters:
key
- a String that the service is expected to receivevalue
- a String that the service will process when the key is received
-
addListener
public void addListener(java.lang.String key, java.util.function.Consumer<java.lang.String> consumer)
Description copied from interface:RuntimeArgsService
Adds a listener to the given key, likeRuntimeArgsService.LAUNCH_LOCAL_NOTIFICATION_KEY
orRuntimeArgsService.LAUNCH_URL_KEY
, so if those occur, the consumer will accept the provided String- Specified by:
addListener
in interfaceRuntimeArgsService
- Parameters:
key
- a String that the service is expected to receiveconsumer
- the operation that will be accepted
-
removeListener
public void removeListener(java.lang.String key)
Description copied from interface:RuntimeArgsService
Removes the listener for the given key- Specified by:
removeListener
in interfaceRuntimeArgsService
- Parameters:
key
- a String that the service is expected to receive
-
-