Class GeoUniq
This Class is implemented according to the Singleton design pattern. The singleton instance of this class can be obtained through
getInstance(Context).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classModels a circular area on the Earth's surface.static enumThis enum model a single consentstatic classDefines an Endpoint that can be set to receive location updates.static classRepresents an area that has to be monitored.static interfaceDefines callback methods to receive updates on the status of a monitoredGeoUniq.GeoFence.static classModels a point on the Earthstatic classThis class model the home location detected for the device.static interfaceDeprecated.This interface is no longer used.static interfaceMap that wrap the consents list and its statusstatic interfaceDefines a callback method to receive the DEVICE-ID assigned by GeoUniq Platform to this device.static interfaceProvides a callback method to be notified of errors after calling some GeoUniq SDK's API methods.static interfaceDefines callback methods to receive updates on the detection of a newGeoUniq.HomeLocation.static interfaceDefines callback methods to receiveLocationobjects after callinggetLocation(float, ILocationListener, IErrorListener).static interfaceInterface to receive callbacks when callinggetLocationHistory(Date, Date, boolean, ILocationsReceiver).static interfaceDefines methods to receive a callback when a motion activity starts or ends.static interfaceRegister a callback to be invoked when privacy consent view is closedstatic interfaceDefines methods to receive a callback when a new position update is detected and sent to GeoUniq analytics platform.static interfaceDefines callback methods to receive updates on the detection of a newGeoUniq.WorkLocation.static classA location detected for the device.static classModels a motion activity, that is, a period of time during which the same motion type (seeGeoUniq.MotionActivity.Type) has been observedstatic enumDefines a set of profiles to to control the trade-off between the precision/accuracy of the tracking and the impact on battery.
Use them withsetPowerProfile(PowerProfile).static enumDefines possible errors that may occur when some specific methods of GeoUniq SDK are called.static classDefines a profile to be set for the tracking functionality.static interfacestatic classThis class model the work location detected for the device. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefines the maximum allowed length for a String passed as parameter tosetCustomId(String).static final intDefines the maximum allowed length for a String passed as parameter tosetLabel(String).static final intDefines the maximum allowed length for a String passed as parameter tosetPushNotificationToken(String).static final StringThe version of GeoUniq SDK -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all motion activity registrations, for anyGeoUniq.MotionActivity.Typeand receiver class.voidderegisterMotionActivityListener(Class<? extends GeoUniq.IMotionActivityListener> listenerClass, GeoUniq.MotionActivity.Type[] motionTypes) Removes motion activity registrations for a listener.voiddisable()Allows to disable the SDK.
Callenable()to enable it again.voidDisables theGeoUniq.CustomEndpoint.voidenable()Allows to enable the SDK.
Calldisable()to disable it.voidEnables theGeoUniq.CustomEndpoint.booleanDeprecated.This method is no longer used.Returns the last detected motion activity.Returns theGeoUniq.CustomEndpointset if any, otherwise returnsnull.Allows to get the custom ID currently set for the device.Allows to get the Device ID assigned by GeoUniq Analytics cloud platform to this device.getGeoFence(String id) Returns theGeoUniq.GeoFencewith the provided ID if found among the set of monitoredGeoFence.Returns the List of monitoredGeoUniq.GeoFenceAllows to get the home location calculated for this device.static GeoUniqgetInstance(android.content.Context context) Allows to obtain the singleton instance of this class
It throws aRuntimeExceptionif anullobject is provided forcontextparameter.getLabel()Returns the label that is currently set for this device.Allows to get the last location known by the SDK.voidgetLocation(float spaceAccuracy, GeoUniq.ILocationListener locationListener, GeoUniq.IErrorListener errorListener) Allows to access the location of the device with the provided space accuracy.booleangetLocationHistory(Date from, Date to, boolean newestFirst, GeoUniq.ILocationsReceiver locationsReceiver) Returns all the positions stored on GeoUniq Analytics platform that were detected during a specified time interval If no location is found in the specified interval, the last location before the interval start time is retrieved.Returns all the motion activity registrations currently active.booleangetPrivacyConsent(GeoUniq.ConsentItem consentItem) Return the status of privacy consentUse this method to obtain a list of all consentsReturns theStringset as push notifications token throughsetPushNotificationToken(String).Returns the profile that is currently used for the tracking functionality.Set<Class<? extends GeoUniq.ITrackingListener>>Returns the set of Class that are set as listener for position updates generated by the tracking functionality.Allows to get the work location calculated for this device.booleanbooleanAllows to know whether the Device ID is available or not;falseotherwise.booleanAllows to known if the SDK is enabledbooleanvoidregisterHomeLocationListener(Class<? extends GeoUniq.IHomeLocationListener> callbackClass) Sets the callback class that will receive updates when the home location changes.voidregisterMotionActivityListener(Class<? extends GeoUniq.IMotionActivityListener> receiverClass, GeoUniq.MotionActivity.Type[] motionTypes) Registers a listener class for receiving a callback when specific types of motion activity start and finish.voidregisterToGroup(String groupId) Allows to register this Device to the Group whose ID is equal to the parametergroupID.voidAllows to register this Device to all the Groups whose name is equal to the parametername.voidregisterTrackingListener(Class<? extends GeoUniq.ITrackingListener> callbackClass) Registers a listener Class to receive position updates generated by the tracking functionality.voidregisterWorkLocationListener(Class<? extends GeoUniq.IWorkLocationListener> callbackClass) Sets the callback class that will receive updates when the work location changes.voidRemoves all tracking listeners.voidRemoves theGeoUniq.CustomEndpoint.booleanremoveGeoFence(String id) Removes theGeoFencewith the provided ID from the set of monitoredGeoFence.voidremoveTrackingListener(Class<? extends GeoUniq.ITrackingListener> callbackClass) Removes a Class set as listener for position updates generated by the tracking functionality.voidvoidsetBalancedPowerAccuracy(boolean balancedPowerAccuracy) Allows you to set the SDK in balanced power accuracy mode.voidsetConsentStatus(boolean isGranted) Deprecated.This method is no longer used.voidsetCustomEndpoint(GeoUniq.CustomEndpoint endpoint) Set aGeoUniq.CustomEndpointthat will receive all the location updates sent to GeoUniq Analytics platform.booleansetCustomId(String customId) Allows to set a custom ID to the device that will be shown when accessing Resources related to this device from GeoUniq Analytics Web API.voidsetDeviceIdListener(GeoUniq.IDeviceIdListener listener) Sets aGeoUniq.IDeviceIdListenerto receive a callback as soon as the Device ID is available.
The callback is returned even if the Device ID was already been assigned when this method is called.voidsetErrorListener(GeoUniq.IErrorListener listener) Sets aGeoUniq.IErrorListenerto receive a callback if an error occurs when starting a basic functionality, such as the background tracking and the motion activity detection.setGeoFence(GeoUniq.GeoFence geoFence) Allows to start monitoring aGeoFence.
A unique ID will be generated and assigned to the providedGeoFence(seeGeoUniq.GeoFence.getId()), provided that an area and callback class has been set for thisGeoFence(seeGeoUniq.GeoFence.Builder.setArea(GeoUniq.CircularArea)andGeoUniq.GeoFence.Builder.setCallbackClass(Class)), otherwisenullwill be returned indicating that theGeoFenceis invalid.voidSets a label that will be attached to each location uploaded on GeoUniq cloud platform.voidsetPowerProfile(GeoUniq.PowerProfile powerProfile) Allows to set aGeoUniq.PowerProfileto control the trade-off between the precision/accuracy of the tracking and the impact on battery.voidsetPrivacyConsent(GeoUniq.ConsentItem consentItem, boolean value) Set the status of a privacy consentvoidsetPushNotificationToken(String token) Allows to set a token for push notifications that will be visible when accessing this device's resources from the WEB API.voidsetTrackingProfile(GeoUniq.TrackingProfile trackingProfile) Sets the desired profile for the tracking functionality.voidsetWakeUpsReduction(boolean wakeUpsReduction) Allows you to set the SDK in wake-ups reduction mode.voidshowConsentDialogAndSet(android.app.Activity activity, GeoUniq.IConsentAlertResponseListener consentAlertResponseListener) Deprecated.This method is no longer used.voidshowPrivacyPolicyAndSet(android.app.Activity activity, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permissionvoidshowPrivacyPolicyAndSet(android.content.Context context, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permissionvoidshowPrivacyPolicySwitchesAndSet(android.app.Activity activity, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permissionvoidshowPrivacyPolicySwitchesAndSet(android.content.Context context, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permissionvoidunregisterHomeLocationListener(Class<? extends GeoUniq.IHomeLocationListener> callbackClass) Remove home location updates for the listener.voidunregisterWorkLocationListener(Class<? extends GeoUniq.IWorkLocationListener> callbackClass) Remove work location updates for the listener.
-
Field Details
-
MAX_LABEL_LENGTH
public static final int MAX_LABEL_LENGTHDefines the maximum allowed length for a String passed as parameter tosetLabel(String).- See Also:
-
MAX_CUSTOM_ID_LENGTH
public static final int MAX_CUSTOM_ID_LENGTHDefines the maximum allowed length for a String passed as parameter tosetCustomId(String).- See Also:
-
MAX_TOKEN_LENGTH
public static final int MAX_TOKEN_LENGTHDefines the maximum allowed length for a String passed as parameter tosetPushNotificationToken(String).- See Also:
-
SDK_VERSION
The version of GeoUniq SDK
-
-
Method Details
-
getInstance
Allows to obtain the singleton instance of this class
It throws aRuntimeExceptionif anullobject is provided forcontextparameter.- Parameters:
context- the application Context- Returns:
- the singleton
GeoUniqinstance
-
disable
public void disable()Allows to disable the SDK.
Callenable()to enable it again. -
enable
public void enable()Allows to enable the SDK.
Calldisable()to disable it. -
isEnabled
public boolean isEnabled()Allows to known if the SDK is enabled- Returns:
trueif the SDK is enabled, false otherwise
-
setErrorListener
Sets aGeoUniq.IErrorListenerto receive a callback if an error occurs when starting a basic functionality, such as the background tracking and the motion activity detection.- Parameters:
listener- theIErrorListenerthat will receive callback methods.
-
setDeviceIdListener
Sets aGeoUniq.IDeviceIdListenerto receive a callback as soon as the Device ID is available.
The callback is returned even if the Device ID was already been assigned when this method is called.- Parameters:
listener- theIDeviceIdListenerthat will receive callback methods.
-
isDeviceIdAvailable
public boolean isDeviceIdAvailable()Allows to know whether the Device ID is available or not;falseotherwise.- Returns:
trueif the Device ID is available
-
getDeviceId
Allows to get the Device ID assigned by GeoUniq Analytics cloud platform to this device.- Returns:
- the Device ID if available or
nullotherwise.
-
setCustomId
Allows to set a custom ID to the device that will be shown when accessing Resources related to this device from GeoUniq Analytics Web API.
The maximum allowed length is indicated in
MAX_CUSTOM_ID_LENGTH- Parameters:
customId- aStringrepresenting the desired ID. Its length must be at most- Returns:
- true if the custom ID is correctly set
-
getCustomId
Allows to get the custom ID currently set for the device.- Returns:
- the custom ID or
nullif it has never been set
-
resetDeviceId
public void resetDeviceId() -
setLabel
Sets a label that will be attached to each location uploaded on GeoUniq cloud platform.
To change label, call this method with a different value for thelabelparameter.
To remove any label, call this method passing thenullvalue for thelabelparameter.- Parameters:
label- a String representing the desired label.
The maximum allowed length is equal toMAX_LABEL_LENGTH.
-
getLabel
Returns the label that is currently set for this device. It may returnnullif no label is set.- Returns:
- the label currently set
-
setPowerProfile
Allows to set aGeoUniq.PowerProfileto control the trade-off between the precision/accuracy of the tracking and the impact on battery.- Parameters:
powerProfile- theGeoUniq.PowerProfileto set
-
setTrackingProfile
Sets the desired profile for the tracking functionality.
Calling this method has effect immediately and permanently. If never called, a tracking profile with all attributes set to their default values will be used.
- Parameters:
trackingProfile- aGeoUniq.TrackingProfileobject indicating the kind of tracking profile- See Also:
-
getTrackingProfile
Returns the profile that is currently used for the tracking functionality.- Returns:
- a
GeoUniq.TrackingProfileobject indicating the kind of tracking profile
-
setWakeUpsReduction
public void setWakeUpsReduction(boolean wakeUpsReduction) Allows you to set the SDK in wake-ups reduction mode. By setting this mode, the wake-ups limits defined by the Android Vitals section of the Google console will not be exceeded, but the tracking will worsen considerably.- Parameters:
wakeUpsReduction- , true to set the SDK in wake ups reduction mode, false otherwise.
-
isWakeUpsReduction
public boolean isWakeUpsReduction()- Returns:
- true if wake-ups reduction mode is enabled, false otherwise.
-
setBalancedPowerAccuracy
public void setBalancedPowerAccuracy(boolean balancedPowerAccuracy) Allows you to set the SDK in balanced power accuracy mode. By setting this mode, it is possible to save battery use, but the positions obtained will be less accurate and the tracking may deteriorate.- Parameters:
balancedPowerAccuracy- , true to set the SDK in balanced power mode, false otherwise.
-
isBalancedPowerAccuracy
public boolean isBalancedPowerAccuracy()- Returns:
- true if balanced power accuracy mode is enabled, false otherwise.
-
getLastKnownLocation
Allows to get the last location known by the SDK. It never leads to a location detection.- Returns:
- The last known location if any. Otherwise
null.
-
getLocation
public void getLocation(float spaceAccuracy, GeoUniq.ILocationListener locationListener, GeoUniq.IErrorListener errorListener) Allows to access the location of the device with the provided space accuracy.
This method return immediately. The response will be returned asynchronously to the
locationListenerparameter throughGeoUniq.ILocationListener.onLocationListened(android.location.Location)andGeoUniq.ILocationListener.onFinalLocationListened(android.location.Location)callback methods.Specifically, if the location can be detected, native Android
Locationobjects will be returned. Otherwise, theGeoUniq.IErrorListener.onError(GeoUniq.RequestResult)callback will be invoked providing aGeoUniq.RequestResultobject indicating the error.- Parameters:
locationListener- an object implementing theILocationListenerinterface which will receive the response through a callbackspaceAccuracy- afloatvalue indicating the the desired accuracy in meters. Values lower than 30 are likely to require using GPS thus increasing battery consumption.errorListener- aGeoUniq.IErrorListenerobject which will receive a callback if the location cannot be detected.- See Also:
-
getLocationHistory
public boolean getLocationHistory(@NonNull Date from, @NonNull Date to, boolean newestFirst, @NonNull GeoUniq.ILocationsReceiver locationsReceiver) Returns all the positions stored on GeoUniq Analytics platform that were detected during a specified time interval If no location is found in the specified interval, the last location before the interval start time is retrieved.
This method returns a boolean indicating whther the operation can be performed or not. This method shouldn't be called if the Device ID is not yet available (see
isDeviceIdAvailable()). In that case, the method will returnfalseThe location history will be returned asynchronously to the
locationsReceiverparameter through theGeoUniq.ILocationsReceiver.onSuccess(LinkedList)callback.
If an error occurs such that locations cannot be retrieved from GeoUniq server, a callback toGeoUniq.ILocationsReceiver.onError()will be returned.
The time interval of interest is specified through two
Dateobjects.- Parameters:
from- aDateobject indicating the beginning of the time frameto- aDateobject indicating the end of the time framenewestFirst- whether the returned positions must be ordered from the newest to the oldest or vice-versalocationsReceiver- theGeoUniq.ILocationsReceiverobject that will receive the callback.- Returns:
trueif the operation can be performed, otherwisefalse
-
registerTrackingListener
Registers a listener Class to receive position updates generated by the tracking functionality.
Once this method is called, each time a new significant position update is detected a new instance of the class indicated by the parameter
callbackClasswill be automatically created and the related callback method will be invoked (seeGeoUniq.ITrackingListener).
Callback methods are invoked regardless of the state of the application, i.e. they are called even after the application has been killed.
A registration remains valid until the same class is unregistered by calling the method
removeTrackingListener(java.lang.Class). Note that a registration remains valid even after the application gets updated
Calling this method more than once with the same
callbackClasshas no effect.- Parameters:
callbackClass- aClassobject representing the listener's class, which must implement the interfaceGeoUniq.ITrackingListener.
The Java class represented by this Class object must have the public no-argument constructor.
-
removeTrackingListener
Removes a Class set as listener for position updates generated by the tracking functionality.
Calling this method providing in
callbackClassa Class that was not registered has no effect. Otherwise, the registration is removed regardless of how many times the listener had been registered (seeregisterTrackingListener(Class)).- Parameters:
callbackClass- aClassobject representing the listener's class, which must implement the interfaceGeoUniq.IMotionActivityListener.
-
getTrackingRegistrations
Returns the set of Class that are set as listener for position updates generated by the tracking functionality.
- Returns:
- a
SetofClassobjects representing the listeners' class
-
removeAllTrackingRegistrations
public void removeAllTrackingRegistrations()Removes all tracking listeners.
(seeregisterTrackingListener(Class)). -
registerMotionActivityListener
public void registerMotionActivityListener(@NonNull Class<? extends GeoUniq.IMotionActivityListener> receiverClass, @NonNull GeoUniq.MotionActivity.Type[] motionTypes) Registers a listener class for receiving a callback when specific types of motion activity start and finish.
Once this method is called, each time one of the
GeoUniq.MotionActivity.Typewithin themotionTypesarray begins or finishes, a new instance of the class indicated by the parameterreceiverClasswill be automatically created and the related callback method will be invoked (seeGeoUniq.IMotionActivityListener).
Callback methods are invoked regardless of the state of the application, i.e. they are called even if the application is not running.
A registration remains valid until the same class is unregistered by calling the method
deregisterMotionActivityListener(Class, MotionActivity.Type[]). Note that a registration remains valid even after the application gets updated
Registrations and de-registrations work independently. Specifically, once a
classhas been registered for a particular set of motion activity types, the sameclasscan be unregistered for any subset of those motion activity types.
Calling this method more than once with the same
receiverClassdoes not replace previous registrations of the same class but has the only effect of adding the new set of motion activities (provided by the parametermotionTypes) to the set of motion activities for which thereceiverClassis already registered. This means that calling this method with exactly the same parameters more than once has no effect.- Parameters:
receiverClass- aClassobject representing the listener's class, which must implement the interfaceGeoUniq.IMotionActivityListener.
The Java class represented by this Class object must have the public no-argument constructor.motionTypes- The motion type.
-
deregisterMotionActivityListener
public void deregisterMotionActivityListener(Class<? extends GeoUniq.IMotionActivityListener> listenerClass, GeoUniq.MotionActivity.Type[] motionTypes) Removes motion activity registrations for a listener.
Calling this method providing in
motionTypesaGeoUniq.MotionActivity.Typefor which the listener specified bylistenerClassis not registered has no effect. Otherwise, the registration is removed regardless of how many times the listener had been registered (seeregisterMotionActivityListener(Class, MotionActivity.Type[])).- Parameters:
motionTypes- The motion type.listenerClass- Listener class
-
getCurrentMotionActivity
Returns the last detected motion activity.- Returns:
- a
GeoUniq.MotionActivityobject representing the last detected motion activity.
-
getMotionActivityRegistrations
public Map<Class<? extends GeoUniq.IMotionActivityListener>,Set<GeoUniq.MotionActivity.Type>> getMotionActivityRegistrations()Returns all the motion activity registrations currently active.- Returns:
- a Map where each key is the
Classobject representing the receiver class and each value is aSetofGeoUniq.MotionActivity.Typeobjects which represent all the motion activities which the callback class is registered for.
-
deregisterAllMotionActivityListeners
public void deregisterAllMotionActivityListeners()Removes all motion activity registrations, for anyGeoUniq.MotionActivity.Typeand receiver class. -
getPushNotificationsToken
Returns theStringset as push notifications token throughsetPushNotificationToken(String). It returnsnullif noStringhas ever been set.- Returns:
- the token
-
setPushNotificationToken
Allows to set a token for push notifications that will be visible when accessing this device's resources from the WEB API.
Such token will be stored by GeoUniq SDK and uploaded on GeoUniq Analytics platform. This token will be obtained when requesting any information that is related to this device through the WEB API or when receiving Alerts for a Trigger.
Note that no check is performed on the correctness of the token. The
tokenparameter is considered just aString.- Parameters:
token- the token to store and upload
-
registerToGroupsWithName
Allows to register this Device to all the Groups whose name is equal to the parametername.- Parameters:
name-Stringindicating the name of the Group(s) of interest
-
registerToGroup
Allows to register this Device to the Group whose ID is equal to the parametergroupID.- Parameters:
groupId-Stringindicating the ID of the Group of interest
-
setCustomEndpoint
Set aGeoUniq.CustomEndpointthat will receive all the location updates sent to GeoUniq Analytics platform.Use the
GeoUniq.CustomEndpoint.Builderto obtain a instanceCustomEndpointof object- Parameters:
endpoint- theGeoUniq.CustomEndpointto be set
-
getCustomEndpoint
Returns theGeoUniq.CustomEndpointset if any, otherwise returnsnull.Use
setCustomEndpoint(CustomEndpoint)to set aCustomEndpoint- Returns:
- the current
GeoUniq.CustomEndpoint
-
removeCustomEndpoint
public void removeCustomEndpoint()Removes theGeoUniq.CustomEndpoint.If no
CustomEndpointwas set, calling this method has no effect. -
enableCustomEndpoint
public void enableCustomEndpoint()Enables theGeoUniq.CustomEndpoint.If no
CustomEndpointwas set, or the one set was already enabled, calling this method has no effect. TheCustomEndpointcan be successively disabled by callingdisableCustomEndpoint(). -
disableCustomEndpoint
public void disableCustomEndpoint()Disables theGeoUniq.CustomEndpoint.If no
CustomEndpointwas set, or the one set was already disabled, calling this method has no effect. TheCustomEndpointcan be successively enabled by callingenableCustomEndpoint(). -
setGeoFence
Allows to start monitoring aGeoFence.
A unique ID will be generated and assigned to the providedGeoFence(seeGeoUniq.GeoFence.getId()), provided that an area and callback class has been set for thisGeoFence(seeGeoUniq.GeoFence.Builder.setArea(GeoUniq.CircularArea)andGeoUniq.GeoFence.Builder.setCallbackClass(Class)), otherwisenullwill be returned indicating that theGeoFenceis invalid.The
GeoFencewill be monitored until it expires (seeGeoUniq.GeoFence.Builder.setExpirationDate(Date)). Whenever its status changes, a new instance of the callback class set for theGeoFencewill be automatically created (seeGeoUniq.GeoFence.Builder.setCallbackClass(Class)) and the callback methodGeoUniq.GeoFenceListener.onStatusChanged(Context, GeoUniq.GeoFence)will be called.- Parameters:
geoFence- TheGeoFenceto monitor- Returns:
- the ID of the
GeoFenceornullif an invalidGeoFencehas been provided
-
removeGeoFence
Removes theGeoFencewith the provided ID from the set of monitoredGeoFence.- Parameters:
id- The ID of theGeoFenceto remove- Returns:
trueif aGeoFencewith the provided ID is found orfalseotherwise
-
getGeoFences
Returns the List of monitoredGeoUniq.GeoFence- Returns:
- the List of monitored
GeoFence
-
getGeoFence
Returns theGeoUniq.GeoFencewith the provided ID if found among the set of monitoredGeoFence. If no monitoredGeoFenceexists with the provided ID, it returnsnull.- Parameters:
id- The id of geofence- Returns:
- the
GeoFencewith the provided ID if any.nullotherwise
-
showConsentDialogAndSet
@Deprecated public void showConsentDialogAndSet(@NonNull android.app.Activity activity, GeoUniq.IConsentAlertResponseListener consentAlertResponseListener) Deprecated.This method is no longer used.Use
showPrivacyPolicyAndSet(Activity, IPrivacyPolicyListener)instead.Show a dialog that ask for privacy consent permission- Parameters:
activity- The activity that owns this dialogconsentAlertResponseListener- Callback called when dialog is closed
-
setConsentStatus
Deprecated.This method is no longer used.Use
setPrivacyConsent(ConsentItem, boolean)instead.Set the status of privacy consent- Parameters:
isGranted- The status that will be set
-
getConsentStatus
Deprecated.This method is no longer used.Use
setPrivacyConsent(ConsentItem, boolean)instead.Return the status of privacy consent set bysetConsentStatus(boolean)- Returns:
- Status of privacy consent
-
showPrivacyPolicyAndSet
public void showPrivacyPolicyAndSet(@NonNull android.app.Activity activity, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permission- Parameters:
activity- The activity that owns this viewnewPrivacyFlowListenerListener- Callback called when dialog is closed
-
showPrivacyPolicyAndSet
public void showPrivacyPolicyAndSet(@NonNull android.content.Context context, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permission- Parameters:
context- The context that owns this viewnewPrivacyFlowListenerListener- Callback called when dialog is closed
-
showPrivacyPolicySwitchesAndSet
public void showPrivacyPolicySwitchesAndSet(@NonNull android.app.Activity activity, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permission- Parameters:
activity- The activity that owns this viewnewPrivacyFlowListenerListener- Callback called when dialog is closed
-
showPrivacyPolicySwitchesAndSet
public void showPrivacyPolicySwitchesAndSet(@NonNull android.content.Context context, GeoUniq.IPrivacyPolicyListener newPrivacyFlowListenerListener) Show a dialog that ask for privacy consents permission- Parameters:
context- The context that owns this viewnewPrivacyFlowListenerListener- Callback called when dialog is closed
-
setPrivacyConsent
Set the status of a privacy consent- Parameters:
consentItem- The consent that will be setvalue- The status that will be set
-
getPrivacyConsent
Return the status of privacy consent- Parameters:
consentItem- The consent that will be read- Returns:
- The status of the consent
-
getPrivacyConsentsMap
Use this method to obtain a list of all consents- Returns:
- A
GeoUniq.IConsentsMapwith the status of all consents
-
registerHomeLocationListener
public void registerHomeLocationListener(Class<? extends GeoUniq.IHomeLocationListener> callbackClass) Sets the callback class that will receive updates when the home location changes.- Parameters:
callbackClass- A class implementingGeoUniq.IHomeLocationListenerinterface.
-
unregisterHomeLocationListener
public void unregisterHomeLocationListener(Class<? extends GeoUniq.IHomeLocationListener> callbackClass) Remove home location updates for the listener.- Parameters:
callbackClass- A class implementingGeoUniq.IHomeLocationListenerinterface.
-
registerWorkLocationListener
public void registerWorkLocationListener(Class<? extends GeoUniq.IWorkLocationListener> callbackClass) Sets the callback class that will receive updates when the work location changes.- Parameters:
callbackClass- A class implementingGeoUniq.IWorkLocationListenerinterface.
-
unregisterWorkLocationListener
public void unregisterWorkLocationListener(Class<? extends GeoUniq.IWorkLocationListener> callbackClass) Remove work location updates for the listener.- Parameters:
callbackClass- A class implementingGeoUniq.IWorkLocationListenerinterface.
-
getHomeLocation
Allows to get the home location calculated for this device.- Returns:
- The home location if available or
nullotherwise.
-
getWorkLocation
Allows to get the work location calculated for this device.- Returns:
- The work location if available or
nullotherwise.
-