Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
0
Question by SarthakHShah7 · Apr 15, 2017 at 08:09 AM · fpsimagefacebooksharing

Share an Image on Faceook

Hey guys, I want to share a screen shot to Facebook with other text content (if possible) or without any content. I found 2 way and I tried both of them none seems to be working perfectly.

I am using Facebook SDK for unity v7.2.2 and unity 5.4.2f2.

The 1st way I deed is using FB.Sharelink. Here is a step by step information about it. 1. Take the screenshot

  1. Store to application.persistendatapath

  2. Upload to other own hosted server

  3. File successfully uploaded on server.

  4. Now put the game for manual wait for 10 second for image uploading.

  5. Once image uploaded on server Facebook sharing dialog appears on device. Current stored image is getting displayed on server.

  6. Post it to Facebook. all post content were fine on dialog on device.

Result at end:. When I saw my post on Facebook i saw other no image and other text content was there.

No when I try to post it on second time what i found on Facebook share dialog is "instead of displaying current saved image on device, Facebook dialog shows previous shared image and when I post it to Facebook it shows other images. it didn't showed previous image also. in post it showing the image that was uploaded 2-3 days ago.

The 2nd way is using FB.API call. Here is the step by step information for executing it 1. Here is code for that

 byte[] imgData = File.ReadAllBytes (Application.persistentDataPath + "/" + fUserName.Value + 
 pngExtention);
 Texture2D imgtex = new Texture2D (333,333);
 imgtex.LoadImage (imgData);
 WWWForm wwwForm = new WWWForm ();
 wwwForm.AddBinaryData("image",imgData,"temp.png");
 FB.API ("me/photos", Facebook.Unity.HttpMethod.POST, ShareCallBack, wwwForm);

  1. When I executed above code I got response back saying "403:Forbidden". It simply means I have authority to use respected website page.

  2. I am using FB.LoginWithReadPermission with following permission :. public_profile, email, user_friends. Do I have to use FB.LoginwithWritePermission with particular permission ?

Please help me on this. Thanks in advance.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by YHS · Dec 12, 2017 at 08:00 AM

You need ask "publish_actions" permission too. Check out the link below.

For anyone who is looking for share screenshot to FB directly, please check the answer there. https://stackoverflow.com/questions/45970150/how-to-share-screenshot-on-fb-with-unity-without-uploading-image/47767625#47767625

Comment
Add comment · 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
0

Answer by peterpunk · Jan 29, 2018 at 01:53 PM

You can generalize that with the notion of sharing "intent". There is a Github project that covers that here and I've put together a detailed answer to cover also IOS, all here.

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Need help with image native sharing 0 Answers

Facebook posting error 0 Answers

How to open Facebook Share Dialog from Unity in Android device? 0 Answers

Sharing fly through video advice 0 Answers

Posting screenshot on Facebook timeline using FB.API seems impossible 1 Answer


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