RequestSender is refactored to provide only one public methods:
RequestSender.send - It saves the request and based on the internal type of the request (default or immediate) it will send all of the requests. When in development mode it will send all the requests too.
RequestSenderTimer is introduced to cycle every 15min and send the collected requests including the 'heartbeat' request:
RequestSenderTimer.start - called when SDK is started or when activity is resumed
RequestSenderTimer.stop - called when activity is stopped
If there is a database exception it is added to RequestSender.localErrors list and send on next sync of saved requests instead of the real requests. Currently no logic for recovery or dropping the db table.
Implementation
RequestSender
is refactored to provide only one public methods:RequestSender.send
- It saves the request and based on the internal type of the request (default or immediate) it will send all of the requests. When in development mode it will send all the requests too.RequestSenderTimer
is introduced to cycle every 15min and send the collected requests including the 'heartbeat' request:RequestSenderTimer.start
- called when SDK is started or when activity is resumedRequestSenderTimer.stop
- called when activity is stoppedIf there is a database exception it is added to
RequestSender.localErrors
list and send on next sync of saved requests instead of the real requests. Currently no logic for recovery or dropping the db table.