Page tree
Skip to end of metadata
Go to start of metadata

 

Target release0.1.0
Theme
Document statusDRAFT
Document ownerGrigory Petrov
Designer
Developers
QA


Functions

Class Targeting_402

The SDK common class.

init

Description

 Method is only required to get the SDK working.

The method should be invoked when application or main activity of the application starts.

Parameters
context (Context)

Android app context. Provided by the Android framework.

If an Activity instance is passed as a Context, the SDK will be able to display default HotButton widgets in the app UI.

If an Application instance is passed as a Context, the SDK will be able to display notification in the status bar as a replacement of HotButton or default HotButton widgets if has a preference to draw system alert windows.

So it's recommended to pass an Application instance if you want to display HotButton widgets on your own and pass an Activity instance if you are relying on the SDK widgets.

developerId (String)Developer Id obtained after registering as a developer.
ModeStandard, Pro

setInvisibleAppAllowedHotType

Description

Method allows developer to restrict types of widgets which can be displayed when app is invisible.

Also we should take into account that any widget can be displayed when app is invisible only if the user explicitly give us such permission by checking option on the HotOffer.

The method is optional.

Parameters
widgetType (InvisibleAppHotType)Type of widget that can be displayed when app is invisible
ModeStandard

notifyAppVisible

Description

Method allows developer to notify SDK that app become visible to user.

The method is optional.

Parameters

 

ModeStandard

notifyAppInvisible

Description

Method allows developer to notify SDK that app become invisible.

The method is optional.

Parameters

 

ModeStandard

setVisibleActivity

Description

Method allows developer to set current visible Activity instance as Context.

It primarily will be used to display HotButton widget when app is not allowed to display

system alert windows.

The method is optional.

Parameters

 

ModeStandard

setHotStateListener

Description

Method notifies the SDK that some delegate exists which is ready to handle hot events.

The method should be invoked AFTER init method if you want to display HotButton widgets on your own.

In that case you will be able to get HotState callbacks to display suitable widgets at the moment.

The method is optional.

Parameters
listener (HotStateListener) 
ModePro

subscribeToHotStateReminder

Description

Method notifies the SDK that some delegate exists which is ready to handle hot reminder.

The method should be invoked AFTER init method if you want to handle hot reminder event on your own.

The method is optional.

Parameters
subscribeToReminder (boolean) 
ModePro

setShowHotOfferImmediate

Description

 Method allows developer to force the SDK to display HotOffer screen instead of HotButton.

Parameters
showHotOfferImmediate (boolean) 
ModeStandard, Pro

setHotButtonPosition

Description

 Method allows developer to set manual HotButton position.

Parameters
x (int)in px units 
y (int)in px units
ModeStandard, Pro

getSDKInstanceId

Description

Method allows developer to get SDK Instance Id.

The SDK Instance Id is a GUID string which generated on the server side

when init method is invoked on the client side for the first time.

It can be useful if the developer wants the app to exchange any data with REST API.

Parameters

 

ModeStandard, Pro

setForbidDebugMode

Description

Method allows developer to forbid the SDK to gather diagnostic information and transmit to the server.

The method is optional.

Parameters
forbidDebug (boolean) 
ModeStandard, Pro

getTestSuite

Description

Method allows to get an instance of Targeting_402_TestSuite.

Parameters

 

ReturnAn instance of Targeting_402_TestSuite.
ModeStandard, Pro

Class HotStateListener 

The listener of the hot state changes.

onHotNeedAppear

DescriptionMethod notifies listener that hot event is occured and HotButton is ready to display.
The parent app should present HotButton itself.
Parameters
hotState (HotState) 
ModePro

 

onHotReminderNeedAppear 

DescriptionMethod notifies listener that hot reminder is occured and can be handled by the parent app.
The parent app should present the reminder widget itself.
Parameters
hotState (HotState) 
ModePro


onHotNeedDisappearSoon

DescriptionMethod notifies listener that hot will be expired soon.
The parent app should present urgent HotButton itself.
Parameters
hotState (HotState) 
ModePro

onHotNeedDisappear

DescriptionMethod notifies listener that hot is not valid now and HotButton shouldn't be presented to customer.
Parameters
hotState (HotState) 
ModePro

 

 

Class HotState 

The state of hot offer.

hotButtonAppeared  

DescriptionMethod notifies the SDK that the delegate presented HotButton itself. The delegate passes View which is presented as HotButton to enable the SDK listen for click event and present HotOffer.
Parameters
hotButton (View) 
ModePro

 

hotReminderAppeared   

DescriptionMethod notifies the SDK that the delegate presented hot reminder itself. The delegate passes View which is presented as hot reminder to enable the SDK listen for click event and present HotOffer.
Parameters
hotReminder (View) 
ModePro

hotButtonUrgentAppeared

Description

Method notifies the SDK that the delegate presented urgent HotButton itself. The delegate passes View which is presented as urgent HotButton to enable the SDK listen for click event and present HotOffer.

The method is intended as a callback for onHotNeedDisappearSoon.

Parameters
hotButtonUrgent (View ) 
ModePro

 

hotButtonDisappeared

DescriptionMethod notifies the SDK that the delegate removed HotButton itself.
Parameters

 

ModePro

 

getHotOfferText  

Description

Method allows developer to get HotOffer text to create own HotBanner.

The HotOffer text will be look like

"BONUS% скидка на всё в PublicName (CLIENT:DESTINATION_TO метров), код CODE, действует до FinalTime."

Example:

"Кафе KFC в ТРК Континент (50 метров), код скидки 778-1854-59653, действует до 14:10."

Parameters 
ModePro
Implementation
status, version
key status resolution

JIRA project doesn't exist or you don't have permission to view it.

View these issues in JIRA

 

getHotUrl 

DescriptionMethod allows developer to get Hot url to redirect user after click on notification.
Parameters

 

ModePro


Enum InvisibleAppHotType

Enumeration list presenting types of widgets which can be allowed

as Hot indicators when app is invisible.

SystemNotificationOnly system notification is allowed
SystemHotButtonOnly HotButton widget is allowed
AllForbiddenAll widget types are forbidden
AllAllowedAll widget types are allowed


Class SocialNetworkAccess

Container for the customer social network credentials.

passTokenData

DescriptionMethod notifies the SDK that the delegate presented urgent HotButton itself. The delegate passes View which is presented as urgent HotButton to enable the SDK listen for click event and present HotOffer.
Parameters
socialNetwork (SocialNetwork)Type of social network (Facebook, VK) 
accessToken (String) 
userId (String)User id is required for Facebook, for VK request to "/me" is accepted after authorization.
ModeStandard, Pro

Enum SocialNetwork

VK (2)
Facebook(3)

Class Targeting_402_TestSuite

Test suite containing utilities which allows a developer to test whether the SDK works correcty after integration.

getDebugHot

Description

Method allows developer to get debug hot by means of the SDK. The SDK is walking through real workflow including REST API calls.

If setHotStateListener was called and the app is subscribed to hot state events, onHotNeedAppear will be called when the workflow complete.

If setHotStateListener was NOT called the HotButton will be displayed by means of the SDK.

Parameters 
ModeStandard, Pro

sendDebugInfo

Description

Method allows developer to send the diagnostic information. The diagnostic information allows us to determine any issues breaking the SDK regular workflow.

Diagnostic information gathering switched off by default, so invoke setDebugMode method after init method call and pass True value as a single parameter to get it enabled.

Parameters
 context (Context) Android app context. Provided by the Android framework.
ModeStandard, Pro

Permissions





getSDKInstanceId