Versions Compared

Key

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

Compile time error will happen if you will not implement IAppoxeeCallable in your Main Camera Unity Script.

...

Set device's alias - a unique identifier tor this device


 

Code Block
languagec#
titleSet Alias - Example
linenumberstrue
	appoxeePlugin.SetDeviceAlias("MyAlias");
...
 	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnSetAlias (String message) {
 	//Your code...
 	}


Get device alias.

public void GetDeviceAlias();
Get device's alias.


 

Code Block
languagec#
titleGet Alias - Example
linenumberstrue
	appoxeePlugin.GetDeviceAlias();
...
	//Matching Callback Method from IAppoxeeCallable, message is the Alias
	void OnGetAlias (String message) {
	//Your code after getting the alias
	} 

 


Remove Alias

public void RemoveDeviceAlias();
Remove device's alias. 


Code Block
languagec#
titleRemove Alias - Example
linenumberstrue
	appoxeePlugin.RemoveDeviceAlias();
...
	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnRemoveAlias(String message) {
	//Your code after removing the alias
	} 

 


Device API 

Device Information

...

Code Block
languagec#
titleIs Device Push Enabled - Example
linenumberstrue
 bool isPushEnabled = appoxeePlugin.IsPushEnabled();


Tags API

Info

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


Remove Tags

public void RemoveTagsFromDevice(String tags);

...

Code Block
languagec#
titleRemove Device Tags - Example
linenumberstrue
	
	appoxeePlugin.RemoveTagsFromDevice("SampleTag1");
...
	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnRemoveDeviceTags (String message) {
	//Your code after removing a tag
	} 

 


Set Tags

public void AddTagsToDevice(String tags);

Set Tags to Device


 

Code Block
languagec#
titleSet Device Tags - Example
linenumberstrue
	appoxeePlugin.AddTagsToDevice("SampleTag1");
...
	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnSetDeviceTags (String message) {
	//Your code after setting a tag
	}
 


Get Device Tags

public void GetDeviceTags();

Get Device's Tags

Info
titleJsonUtility usage

As of Unity3D ver 5.3, the Class JsonUtility is introduced to help parse json object. Please refer to Unity's manual here.

If you are using Unity3D version lower than 5.3 , you may use other JSON parsing open source projects, such as JSONObject or SimpleJSON.

Code Block
languagec#
titleGet Device Tags - Example
linenumberstrue
    [Serializable]
    public class DeviceTags
    {
        public String[] tags;
    }	
...
	appoxeePlugin.GetDeviceTags(); 
...
	//Matching Callback Method from IAppoxeeCallable, message is Device Tags, as a JSONObject represented as String.
	void OnGetDeviceTags(String message) {
        DeviceTags deviceTagsFromJson = JsonUtility.FromJson<DeviceTags> (message);
        String[] deviceTags = deviceTagsFromJson.tags;
		//Rest of your code
	}

 


Application Tags

public void GetTagList();

Get Application's Tags, from which Device Tags can be taken from.

Info
titleJsonUtility usage

As of Unity3D ver 5.3, the Class JsonUtility is introduced to help parse json object. Please refer to Unity's manual here.

If you are using Unity3D version lower than 5.3 , you may use other JSON parsing open source projects, such as JSONObject or SimpleJSON.

Code Block
languagec#
titleGet Application Tags - Example
linenumberstrue
    [Serializable]
    public class AppTags
    {
        public String[] app_tags;
    }
...	
	appoxeePlugin.GetTagList();
...
	//Matching Callback Method from IAppoxeeCallable, message is App Tags, as a JSONObject represnted String.
	void OnGetAppTags (String message) {
        AppTags appTagsFromJson = JsonUtility.FromJson<AppTags> (message);
		String[] appTags = appTagsFromJson.app_tags;
		//Rest of your code
	}

Push API

Enable/Disable Push

public void SetPushEnabled(boolean flag);
Soft Opt In / Out for Push .
flag - set true to enable , false to disable
Code Block
languagec#
titlePush Opt Out - Example
linenumberstrue
	appoxeePlugin.SetPushEnabled(true);
...
	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnPushOptOut (String message) {
	//Your code after Opting in/out 
	}

Custom Fields API

Set Custom Date Field

public void SetDateField(String fieldName,DateTime fieldValue);

fieldName - name of custom field to set.

fieldValue - value of custom date field to set

Code Block
languagec#
titleSet Custom Field - Example
linenumberstrue
	appoxeePlugin.SetDateField("LastPlayed", DateTime.now());
...
	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnSetCustomField (String message) {
	//Your code after setting a custom field
	}

Set Custom Numeric Field

public void SetNumericField(String fieldName,Decimal fieldValue);

fieldName - name of custom field to set.

fieldValue - value of custom field to set.

Code Block
languagec#
titleSet Custom Field - Example
linenumberstrue
	appoxeePlugin.SetNumericField("score", 1000);
...
	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnSetCustomField (String message) {
	//Your code after setting a custom field
	}

Set String Field

public void SetStringField(String fieldName,String fieldValue);

fieldName - name of custom field to set.

fieldValue - value of custom field to set.

Code Block
languagec#
titleSet Custom Field - Example
linenumberstrue
	appoxeePlugin.SetStringField("Name", "John Doe");
...
	//Matching Callback Method from IAppoxeeCallable, message is true/false (is operation successful)
	void OnSetCustomField (String message) {
	//Your code after setting a custom field
	}
 


Get Custom Field

Gets Custom Field.

public void GetCustomFieldAsString(String fieldName);

fieldName - name of custom field to get.

Code Block
languagec#
titleGet Custom Field - Example
linenumberstrue
	appoxeePlugin.GetCustomFieldAsString("Name");
...
	//Matching Callback Method from IAppoxeeCallable, message is custom field value as String
	void OnGetCustomField (String message) {
	//Your code after getting a custom field as callback result.
	} 

Notifications

Last Push Payload Received 

public String GetLastPush();

Gets last push payload from last incoming push notification. Deletes it after returning.

Code Block
languagec#
titleLast Push Payload Received - Example
linenumberstrue
String pushPayload = appoxeePlugin.GetLastPush();
Note
titlePush Notification Callback and Extra Fields Parsing

The method GetLastPush() is the method that should be called every time you wish to handle an incoming push notification. Further explanation on using the Incoming Last Push Notification Method can be found here.

 


Set Application Badge Number (iOS only)
public void setApplicationBadgeNumber(int bdageNumber);
Set the application badge number, where 0 will remove the badge, and any other number will display it, or update a displayed badge.


 

Code Block
languagec#
titleSet Application Badge Number
appoxeePlugin.setApplicationBadgeNumber (0); // The application's badge icon will be removed.
appoxeePlugin.setApplicationBadgeNumber (2); // The application's badge icon will display a badge count of 2.