Reference
Here are all the methods available to you through the ApmService class
User
Login
This method logs in a user inside the ApmService SDK. Usually it should be call inside a callback when the user is connected to your system.
Logout
This method disconnect anyone the ApmService SDK. It should be called after disconnecting anyone from your system.
getUser
This method return the current user connected (if someone is connected) or an empty user object if no one is currently connected.
Statistics
Init
This method initialize the Statistics Service. This is not necessary ! In fact, ApmService initialize automatically this service if it find a correct value for the key "trackingId" inside the ApmConfig
Track
This method sends a custom event to the current Google Analytics DB configured. ApmService has already a defined tracking plan that is automatically tagged.
Partner
Here are all the methods available to communicate directly with our API
getPage
This method sends back a static page that has been configured inside our back-office
burnGift
This method is used to attribute a gift to a user. This will generate an "attributionId" linking user and gift inside our database. A user need to be connected
unsubscribe
This method will unsubscribe a user to the loyalty program. The user can leave a message explaining his unsubscription in the params
ics
This method will refresh ApmService state and get the last settings defined in the back-office. This method should be called if a user is connected.
It can take a RXJS Subject<void>
as param, that will be called after the refresh is completed
getProg
This method will refresh ApmService state and get the last settings defined in the back-office. This method should be called if no user is connected
It can take a RXJS Subject<void>
as param, that will be called after the refresh is completed
getMentions
This method is used to get all "Mentions/CGU" type pages
Generosity
init
This method initialize the Generosity Service. This is not necessary ! In fact, ApmService initialize automatically this service
add
This method is used to add into the generosity buffer a new interaction.
unstack
This method is used to force the Generosity Service to unstack and handle all the interactions inside the queue.
This is not necessary to implement. In fact, each time the Generosity Service is updated, it will start to unstack automatically
UserProperties
UserProperties are sent to the server each time ics or getProg are triggerd
add
This method is used to add new user properties
remove
This method is used to removed user properties
get
This method return the user properties of the current user (or undefined if no one is connected)
State
updateUserState
This method is used to manually update ApmService User State. For example, if you need to change the userBalance without asking the ApmService to make a refresh call, this method is fit for it
Notif
add
This method is used to manually add inside the Notification Service stack, a new notif event. You need to configure notification inside the back-office.
Storage
clear
This method is used to clear all data stored by the SDKs inside LocalStorage or SessionStorage
If no storage is given, it will clear both Local and Session !
Log
updateLevel
This method is used to update the log level of the SDKs. It is useful for debug purposes, and can be managed also inside the back-office
Navigate
to
This method is used to open a deeplink. ApmView should be included in your app if you want this method to work
Last updated