Add log callback, it can help read and collect error message from sdk. The call back function like the following format
({ tag, message }: { tag: string, message: string }) => {
//implement your own logic
}
Parameters
callback: ((error: AmplitudeLogError) => void)
(error: AmplitudeLogError): void
Parameters
error: AmplitudeLogError
Returns void
Returns EmitterSubscription
clearUserProperties
clearUserProperties(): Promise<boolean>
Clears all properties that are tracked on the user level.
Note: This operation is irreversible!!
Returns Promise<boolean>
disableCoppaControl
disableCoppaControl(): Promise<boolean>
Disable COPPA (Children's Online Privacy Protection Act) restrictions on
IDFA, IDFV, city, IP address and location tracking.
Returns Promise<boolean>
enableCoppaControl
enableCoppaControl(): Promise<boolean>
Enable COPPA (Children's Online Privacy Protection Act) restrictions on
IDFA, IDFV, city, IP address and location tracking.
This can be used by any customer that does not want to collect IDFA, IDFV,
city, IP address and location tracking.
Tracks an event. Events are saved locally.
Uploads are batched to occur every 30 events or every 30 seconds
(whichever comes first), as well as on app close.
Sets event upload period millis. The SDK will attempt to batch upload unsent events
every eventUploadPeriodMillis milliseconds, or if the unsent event count exceeds the
event upload threshold.
Sets event upload threshold. The SDK will attempt to batch upload unsent events
every eventUploadPeriodMillis milliseconds, or if the unsent event count exceeds the
event upload threshold.
Sets the minimum cutoff time in millisseconds for sessions to be considered distinct.
The default time is 5 minutes.
Parameters
minTimeBetweenSessionsMillis: number
Returns Promise<boolean>
setOptOut
setOptOut(optOut: boolean): Promise<boolean>
Enables tracking opt out.
If the user wants to opt out of all tracking, use this method to enable
opt out for them. Once opt out is enabled, no events will be saved locally
or sent to the server.
Calling this method again with enabled set to false will turn tracking back on for the user.
Set Amplitude Server Zone, switch to zone related configuration,
including dynamic configuration. If updateServerUrl is true, including server url as well.
Recommend to keep updateServerUrl to be true for alignment.
Parameters
serverZone: string
amplitude serverZone, US or EU, default is US
updateServerUrl: boolean = true
if update server url when update server zone, recommend setting true
Add log callback, it can help read and collect error message from sdk. The call back function like the following format ({ tag, message }: { tag: string, message: string }) => { //implement your own logic }