plugin : KiiCorp.Cloud.Unity Namespace

KiiPushPlugin Class

Unity plugin for push notification.

Syntax

public class KiiPushPlugin : UnityEngine.MonoBehaviour

Remarks

This class is not included in KiiCloudStorageSDK.dll You need to download unity plug-in. Usage.
  1. Create an empty GameObject and attach the KiiPushPlugin.cs to it.
  2. Replace 'com.example.your.application.package.name' with the value of your package name in the AndroidManifest.xml.
  3. Set the SenderID to KiiPushPlugin GameObject for GCM.
  4. Write the following code in your application.
Example
             KiiPushPlugin kiiPushPlugin = GameObject.Find ("KiiPushPlugin").GetComponent<KiiPushPlugin> ();
             kiiPushPlugin.OnPushMessageReceived += (ReceivedMessage message) => {
             	// This event handler is called when received the push message.
             	switch (message.PushMessageType)
             	{
             		case ReceivedMessage.MessageType.PUSH_TO_APP:
             			Debug.Log ("#####PUSH_TO_APP Message");
             			break;
             		case ReceivedMessage.MessageType.PUSH_TO_USER:
             			Debug.Log ("#####PUSH_TO_USER Message");
             			break;
             		case ReceivedMessage.MessageType.DIRECT_PUSH:
             			Debug.Log ("#####DIRECT_PUSH Message");
             			break;
             	}
             	Debug.Log("Type=" + message.PushMessageType);
             	Debug.Log("Sender=" + message.Sender);
             	Debug.Log("Scope=" + message.ObjectScope);
             	// You can get the value of custom field using GetXXXX method.
             	Debug.Log("Payload=" + message.GetString("payload"));
             };
             

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

Members

See Also: Inherited members from UnityEngine.MonoBehaviour.

Public Constructors

Initializes a new instance of the KiiCorp.Cloud.Storage.KiiPushPlugin class.

Public Fields

SenderID string . This setting is needed only on Android.

Public Methods

GetLastMessage () : string
Documentation for this section has not yet been entered.
OnPushNotificationsReceived (string)
This method is called by the unity native plugin when received push message. Don't call this method from unity application.
OnUnregisterPushFailed (string)
Documentation for this section has not yet been entered.
OnUnregisterPushSucceeded ()
Documentation for this section has not yet been entered.
RegisterPush (KiiPushPlugin.KiiRegisterPushCallback)
Registers the push.
UnregisterPush (KiiPushPlugin.KiiUnregisterPushCallback)
Unregisters the push.

Public Events

OnPushMessageReceived Occurs when push message received. This event doesn't occur while application is in the background. Application returns to foreground state, OnPushMessageReceived is called. This event called on UI thread.

Member Details

KiiPushPlugin Constructor

Initializes a new instance of the KiiCorp.Cloud.Storage.KiiPushPlugin class.

Syntax

public KiiPushPlugin ()

Remarks

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

GetLastMessage Method

Documentation for this section has not yet been entered.

Syntax

public string GetLastMessage ()

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

OnPushMessageReceived Event

Occurs when push message received. This event doesn't occur while application is in the background. Application returns to foreground state, OnPushMessageReceived is called. This event called on UI thread.

Syntax

public event KiiPushPlugin.KiiPushMessageReceivedCallback OnPushMessageReceived

Remarks

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

OnPushNotificationsReceived Method

This method is called by the unity native plugin when received push message. Don't call this method from unity application.

Syntax

public void OnPushNotificationsReceived (string payload)

Parameters

payload
Payload.

Remarks

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

OnUnregisterPushFailed Method

Documentation for this section has not yet been entered.

Syntax

public void OnUnregisterPushFailed (string errorString)

Parameters

errorString
Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

OnUnregisterPushSucceeded Method

Documentation for this section has not yet been entered.

Syntax

public void OnUnregisterPushSucceeded ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

RegisterPush Method

Registers the push.

Syntax

public void RegisterPush (KiiPushPlugin.KiiRegisterPushCallback callback)

Parameters

callback
Callback delegate. If exception is null, execution is succeeded.

Remarks

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

SenderID Field

This setting is needed only on Android.

Syntax

[UnityEngine.SerializeField]
public string SenderID

Remarks

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0

UnregisterPush Method

Unregisters the push.

Syntax

public void UnregisterPush (KiiPushPlugin.KiiUnregisterPushCallback callback)

Parameters

callback
Callback delegate. If exception is null, execution is succeeded.

Remarks

Requirements

Namespace: KiiCorp.Cloud.Unity
Assembly: plugin (in plugin.dll)
Assembly Versions: 1.0.0.0