- Home /
The question is answered, right answer was accepted
Share image with hastag
Hi guys, This is android platform game, I creating the game which contain share option now in my game I can share images after taking screenshots. In that share content I have to add a default title and caption. For eg. I taken high score so I decided to share my image, I took screenshot and share into Facebook and more, now the user have to type title for the image, instead of I have to give the title pre-definedly for eg. #SuperContest. Is there any option to achieve this task. so far I created script for taking screenshots and sharing the screenshot in android method.
Answer by Mintonne · Dec 18, 2015 at 10:16 AM
You can't post pre-set text to Facebook... New policies.
Answer by Umresh · Jul 06, 2015 at 09:45 AM
Try
wwwForm.AddField("message", "Your Message with #tag");
add this before calling FB.API
I never used FB.API, I just simply use android intent for sharing the images, is there anyway to add the hashtag text into that, so far I used this script
using UnityEngine;
using System.Collections;
public class ShareApp : $$anonymous$$onoBehaviour {
string subject = "WORD-O-$$anonymous$$AZE";
string body = "PLAY THIS AWESO$$anonymous$$E GA$$anonymous$$$$anonymous$$ GET IT ON THE PLAYSTORE AT LIN$$anonymous$$";
public void shareText(){
//execute the below lines if being run on a Android device
#if UNITY_ANDROID
//Refernece of AndroidJavaClass class for intent
AndroidJavaClass intentClass = new AndroidJavaClass ("android.content.Intent");
//Refernece of AndroidJavaObject class for intent
AndroidJavaObject intentObject = new AndroidJavaObject ("android.content.Intent");
//call setAction method of the Intent object created
intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
//set the type of sharing that is happening
intentObject.Call<AndroidJavaObject>("setType", "text/plain");
//add data to be passed to the other activity i.e., the data to be sent
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_SUBJECT"), subject);
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), body);
//get the current activity
AndroidJavaClass unity = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");
//start the activity by sending the intent data
currentActivity.Call ("startActivity", intentObject);
#endif
}
}
This script is working with all application except Facebook when I press whatsapp, it's add both string value but in facebook it's not working perfectly how can I add this into facebook. This is the exact thing I want.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
2 issues with Facebook Sharing in Window Phone 2 Answers
Share on Facebook 0 Answers
Android Facebook Share button in C#? 0 Answers