HomeAppVirality DocsAndroid SDK IntegrationPublic Classes

Public Classes

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.

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

CampaignDetail Member Variables
Parameter Type Decription
campaignId String Identifier for the campaign
campaignName String Name of the campaign as set on the dashboard
growthHackType enum Type of the growth hack
Ex, Constants.GrowthHackType.Word_of_Mouth, Constants.GrowthHackType.Loyalty_Program, etc.
campaignImgUrl String URL of the image to be used as campaign image
campaignTitle String URL-encoded Campaign Title as set on dashboard
campaignDescription String URL-encoded Campaign Description as set on dashboard
campaignTitleColor String Color code to be used for Campaign Title
campaignDescriptionColor String Color code to be used for Campaign Description
launchMessage String URL-encoded message to be shown with the popup or mini notification for launching growth hack
launchIconId int Identifier for the icon to be used with the popup or mini notification for launching growth hack
launchBgColor String Background color code to be used with the popup or mini notification for launching growth hack
launchMsgColor String Color code for the message to be shown with the popup or mini notification for launching growth hack
launchBtnBgColor String Background color code for the buttons to be used with the popup or mini notification for launching growth hack
launchBtnTxt String Launch button text to be used with the popup or mini notification for launching growth hack
launchBtnTxtColor String Color code for the Launch button text to be used with the popup or mini notification for launching growth hack
remindBtnTxt String Remind button text to be used with the popup or mini notification for launching growth hack
enableMini boolean To show Mini Notification for launching growth hack or not
enablePopUp boolean To show Popup for launching growth hack or not
userWillChoose boolean To know if coupon distribution option is set as User will choose on dashboard
campaignBgColor String Background color code for the campaign
customDomain String Custom Domain to be used in the Share Link
lastModifiedDate String Last date on which campaign has been modified
shortCode String User’s Short Code to be used in the Share Link
referralCode String User’s Referral Code
shareUrl String User’s Share Link
isRewardExists boolean To know if any reward exists for the campaign or not
daysAfterLaunch String Number of days to wait after first app launch to start showing Popup or Mini Notification
noOfLaunches String Number of launches to wait after install to start showing Popup or Mini Notification
forEveryNDays String Number of days to wait from last notification display for showing Popup or Mini Notification
onRemindMeLater String Number of days to wait for showing Popup or Mini Notification again if user earlier chose to remind later
showCampaignFor String Number of times a Popup or Mini Notification can be shown to the user
showCustomLink boolean Whether to show Custom Link as one of the social actions for sharing or not
noSocialActionsFound boolean To know if no social action is found on user device for sharing
noSocialActionsMessage String Message to display if no social action is found on user device for sharing
allSocialItems ArrayList<SocialItem> List of all social items that can be used for sharing
campaignSocialItems ArrayList<SocialItem> List of all social items configured on dashboard for sharing
campaignSocialActions ArrayList<SocialAction> List of social actions configured on dashboard for sharing

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

ProductDetails Member Variables
Parameter Type Decription
productCode String Product Code
productName String Product Name
productImgUrl String Product Image URL
productCategory String Product Category
productPrice String Price of the product
extraInfo JSONObject Extra Information related to the product, which you want to receive later.

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

SocialAction Member Variables
Variable Type Decription
socialActionId int Social Action Identifier
socialActionName String Name of the Social Action
shareMessage String Message to be used while sharing with this Social Action
shareTitle String Title to be used while sharing with this Social Action
shareUrl String User's Share Link
shareImageUrl String URL of the image to be used while sharing
displayOrder int Order of display among all social actions, as set on dashboard
shareMsgType int Type 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.

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
Variable Type Decription
resId int Icon resource identifier for the social item
appname String Name of the social item
packagename String Social item's package name
classname String Class name of the social item to be used
textColor int Text color code for the social item

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
Method Decription
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

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
Variable Type Decription
collectAdvertisingId boolean It tells the SDK whether to collect user's Advertising-Id or not. Default is True.
runEmulatorChecks boolean It tells the SDK whether to run emulator checks to identify emulators or not. Default is False.
runRootChecks boolean It tells the SDK whether to run root checks to identify rooted devices or not. Default is False.
printLogs boolean It tells the SDK whether to print logs or not. Default is False.
apiKey String Your 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 Params Description
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.
Was this article helpful to you? Yes 1 No