Overview
This Android SDK API documentation outlines how to perform various operations on devices running your app using the Appoxee SDK.
SDK Versions:
The following API calls are available in Android FCM SDK v5.0 and later.
Download
Download the latest Android SDK here: Mapp Cloud Mobile SDK
Operations
Push Enable/Disable
This feature controls whether push notifications are sent to a device.
Push Enable/Disable:
Appoxee.instance().setPushEnabled(true);Set to
trueto enable push notifications.Set to
falseto disable push notifications.
Alias
An alias is a unique, user-specific identifier (e.g., the user's or internal Contact ID) that is limited to 254 characters.
Use Cases:
Both the app owner and the Mapp Engage console use the same aliases to identify users.
All devices a specific user owns (e.g., iPhone, iPad) are linked by the same alias.
Aliases allow the segmentation of users based on specific user attributes.
Code Samples
// Set Alias
public RequestStatus setAlias(String alias)
Appoxee.instance().setAlias(alias);
// Get Alias
public String getAlias()
Appoxee.instance().getAlias();
// Added in v6
public RequestStatus setAlias(String alias, boolean resendAttributes)Note:
Aliases are user-specific and shared across devices.
Tags are app-specific, and multiple tags can be assigned to a single device.
When a new alias value is provided and
resendAttributesis set to TRUE, it will trigger a re-sync of all previously set custom attributes with the backend.
Tags
Tags allow you to label users based on the app’s business logic. For example, pet owners can be tagged as "Dog," "Cat," or "Parrot." Tags are useful for creating segments of users and sending targeted push notifications.
Examples:
One notification can be sent to dog owners and another to cat owners.
Add a Tag:
public RequestStatus addTag(String tag) Appoxee.instance().addTag(tag);Get Tags:
public Set<String> getTags() Appoxee.instance().getTags();Remove a Tag:
public RequestStatus removeTag(String tag) Appoxee.instance().removeTag(tag);
Custom Fields
Custom fields let you add specific information, such as strings, numbers, or date variables, to users. These fields help personalize push notifications and campaigns.
Use Cases
Add a user's first name for personalized push messages (e.g., "Hi John, we are…").
Use the user's birthday for a birthday campaign.
Segment users based on their game level.
Code Samples
// Set a Custom Attribute
public RequestStatus setAttribute(String key, String stringValue)
public RequestStatus setAttribute(String key, Number numericValue)
public RequestStatus setAttribute(String key, Date dateValue)
Appoxee.instance().setAttribute(key, value);
// Set Multiple Attributes
public RequestStatus setAttributes(Map<String, Object> attributes)
/*
* Update multiple custom attributes in a single call.
*/
// Get a Custom Attribute
public String getAttributeStringValue(String key)
Appoxee.instance().getAttributeStringValue(key);Device Info
The Device Info API returns various device parameters, such as the installed OS name, version, or Appoxee SDK version. You can also use this API to set device parameters, such as increasing the number of products purchased through the device.
Device Info:
public DeviceInfo getDeviceInfo()
Appoxee.instance().getDeviceInfo(); Log Out
Logs out the current user and allows you to control whether push notifications continue. If set to false, the user won't receive push notifications until they log in again or enable push notifications.
Log Out:
public void logOut(Application application, boolean pushEnable)
Appoxee.instance().logOut(getApplication(), false);