Skip to content

There are various classes used by the AppVirality SDK 2.0 as the POJO(Plain Old Java Object) classes for storing and accessing various related properties efficiently, allowing the SDK to easily manage and structure large sets of data.

Also, it is much easier for the developers integrating our SDK to understand data being returned or passed as part of the various methods or callbacks, making the whole integration process simple.

CampaignDetail

This class contains various member variables, each specifying some campaign related data important for running the campaigns across user devices.

CampaignDetail Member Variables

ParameterTypeDecription
campaignIdStringIdentifier for the campaign
campaignNameStringName of the campaign as set on the dashboard
growthHackTypeenumType of the growth hack
Ex, Constants.GrowthHackType.Word_of_Mouth, Constants.GrowthHackType.Loyalty_Program, etc.
campaignImgUrlStringURL of the image to be used as campaign image
campaignTitleStringURL-encoded Campaign Title as set on dashboard
campaignDescriptionStringURL-encoded Campaign Description as set on dashboard
campaignTitleColorStringColor code to be used for Campaign Title
campaignDescriptionColorStringColor code to be used for Campaign Description
launchMessageStringURL-encoded message to be shown with the popup or mini notification for launching growth hack
launchIconIdintIdentifier for the icon to be used with the popup or mini notification for launching growth hack
launchBgColorStringBackground color code to be used with the popup or mini notification for launching growth hack
launchMsgColorStringColor code for the message to be shown with the popup or mini notification for launching growth hack
launchBtnBgColorStringBackground color code for the buttons to be used with the popup or mini notification for launching growth hack
launchBtnTxtStringLaunch button text to be used with the popup or mini notification for launching growth hack
launchBtnTxtColorStringColor code for the Launch button text to be used with the popup or mini notification for launching growth hack
remindBtnTxtStringRemind button text to be used with the popup or mini notification for launching growth hack
enableMinibooleanTo show Mini Notification for launching growth hack or not
enablePopUpbooleanTo show Popup for launching growth hack or not
userWillChoosebooleanTo know if coupon distribution option is set as User will choose on dashboard
campaignBgColorStringBackground color code for the campaign
customDomainStringCustom Domain to be used in the Share Link
lastModifiedDateStringLast date on which campaign has been modified
shortCodeStringUser’s Short Code to be used in the Share Link
referralCodeStringUser’s Referral Code
shareUrlStringUser’s Share Link
isRewardExistsbooleanTo know if any reward exists for the campaign or not
daysAfterLaunchStringNumber of days to wait after first app launch to start showing Popup or Mini Notification
noOfLaunchesStringNumber of launches to wait after install to start showing Popup or Mini Notification
forEveryNDaysStringNumber of days to wait from last notification display for showing Popup or Mini Notification
onRemindMeLaterStringNumber of days to wait for showing Popup or Mini Notification again if user earlier chose to remind later
showCampaignForStringNumber of times a Popup or Mini Notification can be shown to the user
showCustomLinkbooleanWhether to show Custom Link as one of the social actions for sharing or not
noSocialActionsFoundbooleanTo know if no social action is found on user device for sharing
noSocialActionsMessageStringMessage to display if no social action is found on user device for sharing
allSocialItemsArrayList<SocialItem>List of all social items that can be used for sharing
campaignSocialItemsArrayList<SocialItem>List of all social items configured on dashboard for sharing
campaignSocialActionsArrayList<SocialAction>List of social actions configured on dashboard for sharing

ProductDetails

This class contains various member variables, each specifying some product related data.

ProductDetails Member Variables

ParameterTypeDecription
productCodeStringProduct Code
productNameStringProduct Name
productImgUrlStringProduct Image URL
productCategoryStringProduct Category
productPriceStringPrice of the product
extraInfoJSONObjectExtra Information related to the product, which you want to receive later.

SocialAction

This class contains various member variables, each specifying some data related to the social actions configured for your campaign on dashboard.

SocialAction Member Variables

VariableTypeDecription
socialActionIdintSocial Action Identifier
socialActionNameStringName of the Social Action
shareMessageStringMessage to be used while sharing with this Social Action
shareTitleStringTitle to be used while sharing with this Social Action
shareUrlStringUser’s Share Link
shareImageUrlStringURL of the image to be used while sharing
displayOrderintOrder of display among all social actions, as set on dashboard
shareMsgTypeintType of the share message to be used. Will always be 0 for Referrals, 1 or 2 for With Reward and Without Reward share message respectively for Product Sharing growth hack.

SocialItem

This class contains various member variables, each specifying some data related to the social action app installed on the device. This is different from SocialAction class, as it contains app specific data like appname, packagename, classname, etc.

SocialItem Member Variables

VariableTypeDecription
resIdintIcon resource identifier for the social item
appnameStringName of the social item
packagenameStringSocial item’s package name
classnameStringClass name of the social item to be used
textColorintText color code for the social item

UserDetails

This class provides various methods to set several user details like userName, userEmail, pushToken, etc. This class’s is used mainly to pass user details data to the SDK while initializing it or while updating the user information.

UserDetails Methods

MethodDecription
setPushToken(String pushToken)To set user’s token for push notifications
setUserEmail(String userEmail)To set user’s email address
setUserName(String userName)To set user’s name
setProfileImage(String profileImage)To set user’s profile image URL
setAppUserId(String appUserId)To set user’s id in your app
setMobileNo(String mobileNo)To set user’s mobile number
setCity(String city)To set user’s city
setState(String state)To set user’s state
setCountry(String country)To set user’s country
setReferralCode(String referralCode)To set referrer’s referral code
setExistingUser(boolean isExistingUser)Set True, if user already exists with your app

Config

This class is a configuration class and provides various properties which you can configure as per your usage requirements. This class is used to send configuration data to the AppVirality SDK while instantiating the AppVirality class using getInstance method. Below is a table of all the properties it provides, what they do and their default values.

Config class variables

VariableTypeDecription
collectAdvertisingIdbooleanIt tells the SDK whether to collect user’s Advertising-Id or not. Default is True.
runEmulatorChecksbooleanIt tells the SDK whether to run emulator checks to identify emulators or not. Default is False.
runRootChecksbooleanIt tells the SDK whether to run root checks to identify rooted devices or not. Default is False.
printLogsbooleanIt tells the SDK whether to print logs or not. Default is False.
apiKeyStringYour AppVirality API Key, if you want to provide the API key dynamically at run time, else null.

Methods

setCustomSocialActionData

setCustomSocialActionData(String socialActionName, String packageName, String className, boolean isCustomImpl, int iconId)

This method is used to set the data for custom social actions which you add on dashboard. It lets the SDK know about new custom social actions being added to your campaign so that it can handle them accordingly. You must invoke this method for all the custom social actions you create otherwise they will be ignored by the SDK.

Input Params

Input ParamsDescription
socialActionName
String
This must be same as the name with which you have created the custom social action on dashboard.
packageName
String
This is the package name of the app as displayed on its Google Play Store page in browser’s the search bar.
className
String
This is the fully qualified name of the class which you want to be launched for sharing the invite message. You need to pass this parameter only if the app you are adding provides multiple components for text sharing and you want some particular one(s) of them to be used for sharing else pass it as null.
isCustomImpl
boolean
Set this as True if you are adding a social action with custom implementation else set False for app based custom social action.
iconId
int
Used to set the resource identifier for the icon which you want to be shown for a custom implementation social action. If adding an app based social action pass it as 0.