Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

Info

Tags are not available for DMC customers yet (coming soon)


tag is used to label users with different elements of the app's business logic. 
For example, if your app is intended for pet owners, you can define the different pets as tags ("Dog", "Cat", “Parrot” etc.) and then label users with different tags, depending on the pets they own. 
Tags are a useful way to create Segments: Groups of devices that share the same parameters (in this case, the tag values). 
You can then send Push notifications to the relevant segments (for example, one notification for dog owners and another for cat owners). 

...

Using Tags API Methods must be done under AsyncTask. For example : 

Code Block
languagejava
firstline1
titleTags API Sample
firstline1
linenumberstrue
new AsyncTask<Void, Void, Void>() {

                    ArrayList<String> deviceTags;

                    @Override

                    protected void onPreExecute() {
						//Do what you need before executing, Progress Bar init etc.

                    }

                    @Override

                    protected Void doInBackground(Void... params) {

                        // get all tags

                        allTags = Appoxee.getTagList();
                        Utils.Debug("Got Application Tag List = " + allTags);

                        deviceTags = Appoxee.getDeviceTags();
                        Utils.Debug("Got Device Tag List = " + deviceTags);

                        if (allTags == null)
                            allTags = new ArrayList<String>();

                        if (deviceTags == null)
                        	deviceTags =  new ArrayList<String>();

                        return null;
                    }

                    @Override
                    protected void onPostExecute(Void result) {

                        //Do What you need with the Data, Dismiss Progress Bar etc.
                    }

                }.execute();

 


Tag API Methods

Table of Contents
maxLevel2
minLevel2

...

Adds the specified tags to the device.

Syntax

public static boolean addTagsToDevice(ArrayList<String> tags)

Parameters

ArrayList – a string array of tags to be added to the device.

...

Removes the specified tags from the device.

Syntax

...


public static boolean removeTagsFromDevice(ArrayList<String> tags)

Parameters

ArrayList – a string array of tags to be removed from the device.

...

Gets the current device tag list from the server.

Syntax

public static ArrayList<String> getDeviceTags()

Parameters

ArrayList – a string array of device tags to be returned from the server.

...

Note

The application tag list cannot be changed locally and tags cannot be added to it via code.
To update the global list prior to updating the local copy (on the device), you must login to your Appoxee account, and make the required changes

Syntax

public static ArrayList<String> getTagList()

Parameters

ArrayList – a string array of the application tags to be returned from the server.

...

Clears the local list of device tags from the device cache (the global application tag list cannot be deleted).

Syntax

public static boolean cleanTagCache()

Returns

true if the local list of device tags was successfully deleted from the device cache; false otherwise.