• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Shacxify · Jul 15, 2017 at 12:48 AM · scoresdklinksharefb

Facebook ShareLink & FeedShare Don't Use Title or Description

I'm using Facebook SDK 7.10.0 and whenever I call my ShareLink(); or FeedShare();, the links I use seem to overcome the post. No description, no title.

PIC

T$$anonymous$$s is my code (Share is linked to a button): using System.Collections; using System.Collections.Generic; using UnityEngine; using Facebook.Unity; using UnityEngine.UI;

public class login : MonoBehaviour {

 public GameObject DialogLoggedIn;
 public GameObject DialogLoggedOut;
 public GameObject DialogUsername;
 public GameObject DialogProfilePic;

 // Use t$$anonymous$$s for initialization
 void Awake () {
     FB.Init(SetInit, OnHideUnity);
 }

 void SetInit() {
     if (FB.IsLoggedIn) {
         Debug.Log("FB is logged in");
     } else {
         Debug.Log("FB is not logged in");
     }

     DealWithFBMenus(FB.IsLoggedIn);
 }

 void OnHideUnity(bool isGameShown) {
     if (!isGameShown) {
         Time.timeScale = 0;
     } else {
         Time.timeScale = 1;
     }
 }

 public void FBlogin() {
     List<string> rpermissions = new List<string> ();
     rpermissions.Add("public_profile");
     List<string> ppermissions = new List<string> ();
     ppermissions.Add("publish_actions");

     FB.LogInWithReadPermissions(rpermissions, AuthCallback);
     FB.LogInWithPublishPermissions(ppermissions, AuthCallback);
 }

 void AuthCallback (IResult result) {
     if (result.Error != null) {
         Debug.Log(result.Error);
     } else {
         if (FB.IsLoggedIn) {
             Debug.Log("FB is logged in");
         } else {
             Debug.Log("FB is not logged in");
         }

         DealWithFBMenus(FB.IsLoggedIn);
     }
 }

 void DealWithFBMenus (bool IsLoggedIn) {

     if (IsLoggedIn) {
             DialogLoggedIn.SetActive (true);
             DialogLoggedOut.SetActive (false);

             FB.API("/me?fields=first_name", HttpMethod.GET, DisplayUsername);
             FB.API("/me/picture?type=square&height=128&width=128", HttpMethod.GET, DisplayProfilePic);
     } else {
         DialogLoggedOut.SetActive (true);
         DialogLoggedIn.SetActive (false);
     }
 }


 void DisplayUsername (IResult result) {
     Text Username = DialogUsername.GetComponent<Text>();

     if (result.Error == null) {
         Username.text = "Hi there, " + result.ResultDictionary["first_name"];
     } else {
         Debug.Log(result.Error);
     }
 }

 void DisplayProfilePic (IGraphResult result) {
     if (result.Texture != null) {
         Image ProfilePic = DialogProfilePic.GetComponent<Image>();

         ProfilePic.sprite = Sprite.Create(result.Texture, new Rect(0,0,128,128), new Vector2());
     }
 }

 public int score = 47;

 public void Share () {
     /*Dictionary<string, string> scoreData = new Dictionary<string, string>() {{"score", score.ToString()}};
     FB.API ("/me/feed", HttpMethod.POST, ShareCallback, scoreData);*/
     FB.ShareLink(
         contentTitle:"My Game!",
         //contentURL: new System.Uri("http://google.com"),
         contentDescription: "Success Shared",
         callback:ShareCallback
     );
 }

 void ShareCallback (IResult result) {
     if (result.Cancelled) {
         Debug.Log("Share Cancelled");
     } else if (!string.IsNullOrEmpty(result.Error)) {
         Debug.Log("Error on Share!");
     } else if (!string.IsNullOrEmpty(result.RawResult)) {
         Debug.Log("Success on share");
     }
 }



Comment
coolalex
hamokshaelzaki
SmartMirror

People who like this

3 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Fireflow-Prime · Jul 26, 2017 at 11:56 AM

Having the same problem. I've checked the payload sent to the android native lib and all seems ok. But the ShareLink just displays the informations gathered by the url, not the custom title, description or image.

Very weird because it definitly worked 1 month ago.

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by jahester · Aug 14, 2017 at 07:49 PM

I've spent hours struggling with t$$anonymous$$s issue using ShareLink t$$anonymous$$nking it must be our image hosting. It appears the argument list has changed. The documentation now only shows two arguments:

https://developers.facebook.com/docs/unity/reference/current/FB.ShareLink

So, apparently you can't specify an image and descriptive text anymore.

Comment
Fireflow-Prime
Jack-Mariani

People who like this

2 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by MaximSpirikhin · Jan 12, 2018 at 11:35 AM

Having the same issue. Any solution?

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jahester · Jan 12, 2018 at 07:57 PM 0
Share

See my answer above. FB has changed the SDK and server API so Sharelink only takes a URL and callback as arguments now. Unfortunately, I don't think there's going to be a solution unless they decide to put the prior functionality back.

avatar image

Answer by coutlass-supreme · Feb 25, 2018 at 05:26 PM

The sharelink now takes properties from the website itself, take a look at t$$anonymous$$s websites source code: http://socialevent.mx/mirrorwebapp/sites/foto.php?img=636551232914581618.png

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Amirraza · Jan 01, 2019 at 03:46 PM 0
Share

@coutlass-supreme What if want to share highscore with this information,My heighest score variable is in c# Script How can i access it in this html file..

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

75 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

FB Integration 0 Answers

adding a share button. 0 Answers

How to create a shareable link for my project? 2 Answers

How to google plus share in unity for Android games 0 Answers

Facebook Login Invalid App Id : 0 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges