You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
namespace uc
|
|
|
|
|
|
{
|
|
|
|
|
|
public class FBFanPage : MonoBehaviour
|
|
|
|
|
|
{
|
|
|
|
|
|
public string accessToken = "EAAE8xH05OpMBAJzKzgyAX9LyXYEempmuLS986ZAoewqSgcRY8RX8uVYjAWVfBpxytfGV6kHZAMVuEHe0tLVDYAuo09UbypvMDt7VRfXTyqiZBfQfRDA1Vby9K8WcGWrkZAz6gszzY6EHqSoZAcR02uwdqueAXrX4ZD";
|
|
|
|
|
|
public string pageId = "178528412614532";
|
|
|
|
|
|
|
|
|
|
|
|
public void Upload(FBFanPagePhoto photo)
|
|
|
|
|
|
{
|
|
|
|
|
|
StartCoroutine(Upload2FB(photo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IEnumerator Upload2FB(FBFanPagePhoto photo)
|
|
|
|
|
|
{
|
|
|
|
|
|
string url = "https://graph.facebook.com/" + pageId + "/photos?access_token=" + accessToken;
|
|
|
|
|
|
Debug.Log("fb fan page upload: " + url);
|
|
|
|
|
|
|
|
|
|
|
|
WWW w = new WWW(url, photo.GetForm());
|
|
|
|
|
|
yield return w;
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(w.error))
|
|
|
|
|
|
{
|
|
|
|
|
|
print(w.error);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
print("Finished Uploading Photo");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|