Beispiel #1
0
    public void                     ShowFeedDialog(Dictionary <string, string> bundle, HandleDialogEvent handle)
    {
        int iid = generateNextID();

        dialog_handles.Add(iid, handle);
        _ShowFeedDialog(bundle, iid);
    }
Beispiel #2
0
    public void                             FacebookAgentReceiveAgentEvent(string json)
    {
        Hashtable data = (Hashtable)MiniJSON.JsonDecode(json);
        int       iid  = int.Parse(data["iid"].ToString());
        int       eid  = int.Parse(data["eid"].ToString());

        switch (eid)
        {
        case 1:                         // req success
        case 6:
            if (req_handles.ContainsKey(iid))
            {
                HandleRequestEvent handle = req_handles[iid];
                if (handle != null)
                {
                    handle(FacebookRequestEvent.Success, "");
                }
                req_handles.Remove(iid);
            }
            else
            {
                Debug.Log("Could not found handle for iid: " + iid);
            }
            break;

        case 2:                         // req failed
        case 7:
            if (req_handles.ContainsKey(iid))
            {
                HandleRequestEvent handle = req_handles[iid];
                if (handle != null)
                {
                    handle(FacebookRequestEvent.Failed, data["error"].ToString());
                }
                req_handles.Remove(iid);
            }
            else
            {
                Debug.Log("Could not found handle (request) for iid: " + iid);
            }
            break;

        case 3:                         // dialog success
            if (dialog_handles.ContainsKey(iid))
            {
                HandleDialogEvent handle = dialog_handles[iid];
                if (handle != null)
                {
                    handle(FacebookDialogEvent.Success, "");
                }
            }
            else
            {
                Debug.Log("Could not found handle (dialog) for iid: " + iid);
            }
            break;

        case 4:                         // dialog cancel
            if (dialog_handles.ContainsKey(iid))
            {
                HandleDialogEvent handle = dialog_handles[iid];
                if (handle != null)
                {
                    handle(FacebookDialogEvent.Canceled, "");
                }
            }
            else
            {
                Debug.Log("Could not found handle (dialog) for iid: " + iid);
            }
            break;

        case 5:
            if (dialog_handles.ContainsKey(iid))
            {
                HandleDialogEvent handle = dialog_handles[iid];
                if (handle != null)
                {
                    handle(FacebookDialogEvent.Failed, data["error"].ToString());
                }
            }
            else
            {
                Debug.Log("Could not found handle (dialog) for iid: " + iid);
            }
            break;
        }
    }
	public void			ShowFeedDialog(Dictionary<string, string> bundle, HandleDialogEvent handle)
	{
		int iid = generateNextID();
		dialog_handles.Add(iid, handle);
		_ShowFeedDialog(bundle, iid);
	}