↓変更点が、ここが大雑把に書いててわかりやすい
URL:http://blog.motoo.net/2012/09/07/194342
■iOS編
http://prime31.com/support/2569/how-can-i-get-twitter-api-v1-1-working
・TwitterBinding.cs
public static void postStatusUpdate(string status) { if (Application.platform == RuntimePlatform.IPhonePlayer) { //_twitterPostStatusUpdate( status ); // shinriyo modified var dict = new Dictionary<string,string>(); dict.Add("status", status); TwitterBinding.performRequest("POST", "1.1/statuses/update.json", dict); } }
→ _twitterPostStatusUpdateを使うのを辞めてカスタムのPOSTで代用
しかし、動かない??
■Android編
URL: http://prime31.com/support/2529/android-twitter-is-still-using-rest-api-v1-which-longer-valid
・TwitterAndroid.cs
普通の投稿メソッド
// Posts an update to the users timeline public static void postUpdate(string update) { if (Application.platform != RuntimePlatform.Android) { return; } //_plugin.Call( "postUpdate", update ); // shinriyo modified Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("status", update); TwitterAndroid.performRequest("post", "1.1/statuses/update.json", dict); }
画像つき投稿メソッド
// Posts an update with an image. Please note that the image will add ~22 characters to the status update public static void postUpdateWithImage(string update, byte[] image) { if (Application.platform != RuntimePlatform.Android) { return; } ///_plugin.Call( "postUpdateWithImage", update, image ); // shinriyo modified Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("status", update); dict.Add("media[]", image); TwitterAndroid.performRequest("post", "1.1/statuses/update_with_media.json", dict); // alternative method //var postImageMethod = AndroidJNI.GetMethodID( _plugin.GetRawClass(), "postUpdateWithImage", "([Ljava/lang/String;B)V" ); //AndroidJNI.CallObjectMethod( _plugin.GetRawObject(), postImageMethod, AndroidJNIHelper.CreateJNIArgArray( new object[] { update, image } ) ); }