Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Released] Mobile Social Plugin

Discussion in 'Assets and Asset Store' started by lacost, Feb 21, 2014.

  1. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Plugin provides the functionality to use Twitter and Facebook API on IOS and Android devices.
    You can write code once and be sure that it will work the same on your IOS and Android app.

    $Mobile_Social_big_cut.png

    However some API actions may looks different, on IOS / Android even if it do absolutely the same for example posting/authorization. You can find out more about differences in the Documentation.

    Online Documentation | Purchase on Asset Store

    Twitter:
    * User Auntification
    * Loading User Data
    * Posting
    * Posting with image

    Facebook:
    Provided facebook api as wrapper class around Unity Facebook SDK. With means all Unity Facebook SDK will be completely available for you. Wrapper include API for:
    * User Auntification
    * Loading User Data
    * Posting
    * Posting with image
    *Loading friends information


    How to get support
     
    Last edited: Feb 21, 2014
  2. novello_io

    novello_io

    Joined:
    Nov 22, 2009
    Posts:
    293
    Figured I'd post about the FB stuff here :) How can I get a list of friends restricted to those who have installed and connected to my app?
     
  3. novello_io

    novello_io

    Joined:
    Nov 22, 2009
    Posts:
    293
  4. deiong

    deiong

    Joined:
    May 24, 2013
    Posts:
    79
    is there the ability for Facebook friends to send each other posts like send them a power up etc etc post in this and when you start a game connect and receive said power up??
     
  5. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Hello. Thanks a lot for your questions.


    Just a little bit explanation. The Facebook part of plugin this is some kind of wrapper class for official Unity Facebook SDK. With mean if plugins does not contains some functionality, you can simply use Unity Facebook SDK feature, or send request directly to the Facebook Open graph api FB.Api to get any information you need.
    I believe this is answer for JesseAlexander question.

    Yes, you can actually use Post function to post any link text and image to specified friend id. But in order to make functionally you described, you should have your own server part with will do this.

    Basically you positing some link to your friend with secret key as get url parameter. when web app is launched by this url, you can transfer secret key as get parameter to your server, and add some power ups to player.
     
  6. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,180
    Can this FB API wrapper be used to monitor the FB Messages activity while playing a game?
     
  7. moopi

    moopi

    Joined:
    Apr 24, 2012
    Posts:
    39
    Hi!

    Do I need this plug-in to get same functionality for both Android and IOS?

    At the moment, I have both Android native plugin and IOS native plugin from you. It looks like Android side of this social plugin is included in the
    Android native plugin (Facebook Unity plugin wrapper and direct Twitter integration), but the IOS native plugin have more "limited" Facebook and twitter functionality (uses only native IOS interfaces).

    Br,

    - Moopi
     
  8. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Only advertised functions

    Yea, IOS plugin has only native FB and Twitter Integration. You need this plugin to use social feature on both platforms (WP8 platform support also coming soon)

    Cheers!
     
  9. htdreams

    htdreams

    Joined:
    Mar 29, 2014
    Posts:
    9
    Hi!

    I've purchased your plugin, very happy with it, has that "check example, mount in five minutes your version, it works" flavor that i really appreciate :)

    But i have one question: i'm sharing player score to facebook and twitter, so i put into a texture2D a graphic, with a banner and player name&score, but, while twitter publish it cristal clear (png image?) facebook puts an ugly and blurry jpg image... Is there a way to obtain a good image in facebook as the twitter one?

    Here is the twitter post:

    $mobilesocialplugin_twitterpost.png

    And here the blurry facebook post:

    $mobilesocialplugin_facebookpost.png
     
    Last edited: Apr 18, 2014
  10. lilboylost

    lilboylost

    Joined:
    Feb 12, 2014
    Posts:
    265
    Thanks for the great plugin.

    @Posting to facebook with image:
    Does it allow user to post image+text ? Does it prompt user showing image and asking for text before posting?
     
  11. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Hello, Thanks for the report ill investigate why it happens (probably facebook decoding or something) and will try to find some workaroudns


    Yep

    Nope, you can find more plugin behaviour info here:
    https://docs.google.com/document/d/..._06bk3weoVOOD-0nY/edit#heading=h.huiny7v84d6h
     
  12. roponator

    roponator

    Joined:
    Mar 20, 2014
    Posts:
    1
    Hello,

    I got your plugin and its great, but then I put in AdMob/changed the manifest or something and twitter stopped working.

    Here is the logcat output (+some of my debug output). Do you have any idea what might be wrong?

    http://pastebin.com/JNJgMWTV
     
    no-kyu likes this.
  13. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Hello. yep looks like the main activity is UnityPlayerNativeActivity, but it should be AndroidNativeBridge.
    You need to switch it back in your AndroidManifest.

    P.S. what AdMob plugin you currently using?
     
  14. Soilworker

    Soilworker

    Joined:
    Jan 20, 2014
    Posts:
    3
    Thanks for the great plugin! I'm currently using it in the upcoming Android version of my first game (which I released to iOS in April and uses a number of your other plugins.)

    One suggestion in regard to Twitter on Android, though - I really would love it if at some point we could give users a preview of what they are about to post (and the ability to edit or cancel it, just like with Facebook) instead of instantly posting in the background. I must admit that during testing, I was quite shocked to find I'd made some high score posts to my own Twitter feed in the background. :?

    Overall, I'm extremely happy with all of the assets I've purchased from you, and your stellar level of support. :cool:
     
  15. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,037
    hi lacost,

    do you plan to add windows phone 8 support to this package? i will complete your set of plugins :)
     
  16. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    yep.
    WP8 Native coming this week.
    Mobile Ads will be extended as next step, and then social plugin probably.


    Thanks.
    I can do some native window with text, but not sure if you will like it, so steel thinking about it.
    I though developers will do preview windows by their selfs, with will be designed using game style.
     
  17. areisv

    areisv

    Joined:
    May 17, 2014
    Posts:
    1
    I use SPFacebook.instance.Post, It log post complete in OnPost Event. But not appear on my wall !!! .... SPFacebook.instance.PostImage is show correctly in wall
     
  18. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Looks like very odd issue.
    Just checked and it work fine. If you steel have this issue, please send me your app logs in PM.
    Cheers!
     
  19. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    707
    Hello, one question, is this compatible with non mobile targets? Ie: desktop, web.
    Thanks!
     
  20. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Hello. Nope, only Mobile platforms currently. Planing to add WP8 shortly.
     
  21. lilboylost

    lilboylost

    Joined:
    Feb 12, 2014
    Posts:
    265
    Does it override AndroidManifest.xml?
    Is there a workaround to use this plugin if I do not want to extend override my native AndroidManifest.xml
    I can surely add more stuff to existing AndroidManifest.xml.
     
  22. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
  23. htdreams

    htdreams

    Joined:
    Mar 29, 2014
    Posts:
    9
    Hi!

    I'm using this plugin and it works ok on Android, but i have some problems on iOs:

    1:
    Twitter sharing works on iOS 6 devices, i have an iPad 1st Gen and the game closes itself when the script makes the call SPTwitter.Init(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);

    wich hangs in XCode in IOSTwitterPlugin.mm at

    -(BOOL) IsTwitterAvaliable {

    return [SLComposeViewControllerisAvailableForServiceType:SLServiceTypeTwitter];

    }

    Could it be this code doesn't works in iOS 5?

    2:
    And then, i have a Facebook app configured and made public, but can't use it from my game, when the script makes the call SPFacebook.instance.Login("email,publish_actions"); the device shows a web page for the user to login with his facebook credentials, but, once the user sends the login form (or if the user already has facebook account info in his phone settings) it shows a facebook error page with a message "App not set: The developers of this app have not set up this app properly for Facebook Login"

    I've followed all your steps in documentation, and here are my facebook app settings, is anything wrong?









    I have the correct App id in the Unity menu "Facebook/edit settings"

    As i said, on Android devices all works like a charm :)

    Thanks!
     
  24. Subliminalman

    Subliminalman

    Joined:
    Sep 11, 2012
    Posts:
    47
    I'm using the Twitter Posting on both iOS and Android and it's working great on iOS.
    On Android though it's not posting anything. I'm testing on an LG G2 running Android 2.3.4
    Does twitter only work on 4.x?

    Thanks!
     
  25. htdreams

    htdreams

    Joined:
    Mar 29, 2014
    Posts:
    9
    Hi!

    What version of iOS do you have? in my 6+ devices twitter posting works if the user has his credentials in the twitter phone settings, in my 5.x device the game closes when doing twitter initialization.

    In android i've tested only in 4.x devices, so i can't tell. Check if you have twitter user credentials in phone settings, although in Android 4.x it didn't needs it, the twitter login asks for credentials (which it doesn't do in iOS)
     
  26. Subliminalman

    Subliminalman

    Joined:
    Sep 11, 2012
    Posts:
    47
    @htdreams
    Actually I'm having the same issue you are on iPad 1.

    I found out the issues I am having with the plugin is that I have multiple Android plugins and I can't figure out how to get them to play nice.

    I have the Mobile Social Plugin and the Kamcord plugin. I tried to follow the instructions here https://docs.google.com/document/d/1px0BVXcZqgrW99OQV4bM7q1rD5NYaCYTxXnn4eS4ytY/edit#
    on how to get the plugin to play nice with other plugins but I wasn't successful with building out a working jar file.

    Ive been working on this all day and I'm about to go insane!

    Any help would be extremely appreciated
     
  27. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Yep, IOS sharing API dosen't support IOS5 only 6 and 7.


    As far as I get, this is happends on your released app.
    publish_actions - requires app check by facebook team. Is your app got live on facebook?


    It should work on Android 2.3+
    Please send me the log-cat log or drop e-mail to stans.assets@gmail.com

    Yep IOS5 is not supported by apple sharing framework.


    I need more info to help you. Please describe what exactly going wron for you.
    You can describe it here or send an e-mail.
    Cheers!
     
  28. htdreams

    htdreams

    Joined:
    Mar 29, 2014
    Posts:
    9
    Ok, so no Twitter sharing in IOS5, this also affects facebook sharing?


    You mean the facebook app config or the ios app published in app store?, if you check my first screenshot, the one with "status & review" section of my facebook app config, it's marked as public, is this the same as live?

    Thanks!
     
  29. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Not sure, Facebook integration is build on Unity Facebook SDK.


    Not sure, give me your app url please.
    And send me your device log. to find out what's going wrong with facebook.
    Cheers!
     
  30. binarie

    binarie

    Joined:
    Dec 18, 2012
    Posts:
    8
    When attempting to connect to Facebook on an iOS device I also receive this error:
    "App not set: The developers of this app have not set up this app properly for Facebook Login"

    I have removed all of the iOS Native, Google Mobile Ads and Mobile Social plugins, updated the MSP to 2.8 and imported it in on it's own and still the message is all I get when building to a device.

    When I run the FacebookExample Scene in the editor I can connect using the Access Token. I can then post if I select 'Post Screenshot'.

    If I select 'Post Message' (or 'Post Message with Auth') I receive these errors in editor:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)

    ArgumentException: Getting control 1's position in a group with only 1 controls when doing Repaint

    The big issue is that it won't even connect on the devices.

    It will work if I create a blank project, import the MSP and build to a device.

    So it appears that updating these plugins in a project will cause them to fail. Is there some cached setting that could be causing this issue?
     
  31. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Hello. Sorry for inconvenience. Some times if plugins code was refactored can be issue with update.
    I did small How To Update Guide.
    I hope it helps. I will send you latest builds, Hope it will solve your issue.

    Cheers!
     
  32. binarie

    binarie

    Joined:
    Dec 18, 2012
    Posts:
    8
    It appears that this issue was caused by appending the project when exporting to Xcode.

    After updating the plugins I created a fresh build, re-linked the libraries and it's working now.

    Cheers!


     
  33. Stans-Assets

    Stans-Assets

    Joined:
    Jun 20, 2014
    Posts:
    57
    MobileSocialPlugin v 2.8 just released.



    Code Refactor:
    Removed:
    Assets/Extensions/MobileSocialPlugin/Scripts/Android/Twitter
    Assets/Plugins/IOS/Unity3d.m
    Assets/Plugins/IOS/Unity3d.h
    Assets/Plugins/IOS/SPDataUtility.m
    Assets/Plugins/IOS/SPDataUtility.h


    Added:
    Assets/Extensions/GooglePlayCommon/Social/Twitter/Manage
    Assets/Plugins/IOS/ISNDataConvertor.m
    Assets/Plugins/IOS/ISNDataConvertor.h


    Fixes:
    Conflict with IOS Native Plugin Fixed
     
  34. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Thanks for letting me know! I glad tha your problem is solved.
    Cheers!
     
  35. danieldownes

    danieldownes

    Joined:
    Apr 20, 2013
    Posts:
    9
    We recently bought your plugin, mainly to save time sharing to Facebook + Twitter.

    Works fine on iOS, however on Android nothing appears when share buttons are pressed.

    We did not do user authentication (as suggested by the docs if we only want to share).

    I've tried some of the other things this thread, like the tweak to the manifest, however still having problems.

    Here is the catlog output when the FB share button is pressed, and is similar for twitter.
    Wasn't sure what the NullReference was about as, as I said, works fine in iOS.

    Code (csharp):
    1.  
    2. E/NativeActivity(15232): channel '41705a18 com.our.app/com.androidnative.AndroidNativeBridge (client)' ~ Failed to receive dispatch signal.  status=-11
    3. I/Unity  (15232): NullReferenceException: Object reference not set to an instance of an object
    4. I/Unity  (15232):  at MSPAndroidSocialGate.StartShareIntentWithSubject (System.String caption, System.String message, System.String subject, UnityEngine.Texture2D texture, System.String packageNamePattern) [0x00000] in <filename unknown>:0
    5. I/Unity  (15232):  at MSPAndroidSocialGate.StartShareIntent (System.String caption, System.String message, UnityEngine.Texture2D texture, System.String packageNamePattern) [0x00000] in <filename unknown>:0
    6. I/Unity  (15232):  at SPShareUtility.TwitterShare (System.String status, UnityEngine.Texture2D texture) [0x00000] in <filename unknown>:0
    7. I/Unity  (15232):  at SPShareUtility.TwitterShare (System.String status) [0x00000] in <filename unknown>:0
    8. I/Unity  (15232):  at ShareMenu.twitterBtnPressed () [0x00000] in <filename unknown>:0
    9. I/Unity  (15232):  at (wrapper delegate-invoke) System.Action:invoke_void__this__ ()
    10.  
    We are using the latest version of MSP, Unity 4.3.4f1

    Please can you point us in the right direction?

    Cheers,
    Daniel & Oli
     
  36. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Hello. Thanks for report. Issue fixed. New version will be live shortly on assets store
    I will send you fox by e-mail.
    Cheers!
     
  37. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    I'm very excited to use this package! However, I get tons of errors (all the same it appears) regarding PBXBuildFile.cs.

    "Assets/Editor/iOS/third_party/XCodeEditor-for-Unity/PBXBuildFile.cs(7,22): error CS0101: The namespace `UnityEditor.XCodeEditor' already contains a definition for `PBXBuildFile'"

    I assume this is related to the editor. I have the Hedgehog Team EasyTouch package in the Main Menu -> Tools -> Hedgehog Team

    Can these 2 packages coexist or do I need to move some files/folders around?

    Using Unity 4.3.4 on Mac & Xcode 5.1.1
     
    Last edited: Jun 29, 2014
  38. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    I guess conflict that is unity fb plugin (with comes with mine puling) is one who conflicting. If you will send me your project I will try to solve the conflicts.
    Cheers!
     
  39. Backward pieS

    Backward pieS

    Joined:
    Feb 7, 2013
    Posts:
    20
    The plugin works perfectly for posting screengrabs from my game to Twitter on my Samsung Galaxy S3 phone and Asus Memopad, but nothing happens when using my Samsung Nexus 10 tablet.

    I have fresh installs of Twitter on all the devices, and am signed in to my account on each. Any idea why it's not working on the Nexus? Is there some setting on the device that might be incorrect?
     
  40. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Hello. I am also have Nexus 10, and it's works with n problem. Can you please send log-cat log to the stans.assets@gmail.com?
    Cheers!
     
  41. Backward pieS

    Backward pieS

    Joined:
    Feb 7, 2013
    Posts:
    20
    I'll look into getting you a logcat - I'm not too familiar with the process so it might not be until tomorrow. :)

    Thanks!

    *I'm starting to think it's something with this tablet, because I can't post to facebook either (I can post to facebook from the other devices just fine).

    **Logcat has been emailed.
     
    Last edited: Jul 1, 2014
  42. Rocco-Salvetti

    Rocco-Salvetti

    Joined:
    Jul 15, 2013
    Posts:
    6
    Twitter is not working for me (Android). I read that eventually this may happen and that you are going to release an update soon, I hope within this week. :)
    Thank you.

    R.
     
  43. Backward pieS

    Backward pieS

    Joined:
    Feb 7, 2013
    Posts:
    20
    Yesterday I mentioned I could post to Facebook (on Android) just fine, but I'm actually having a problem with the message not showing up.

    I use "PostNativeScreenshot" to submit a screen grab and default message. The screenshot appears in the pop-up posting box but there is no message. I verified that the string holding the message is getting properly passed to SPShareUtility, which I have not edited in any way.

    This happens across multiple devices, all with fresh FB installs. I have the latest version of the mobile social plugin as well. Let me know if you need a logcat. ;)

    *Logcat has been emailed.
     
    Last edited: Jul 1, 2014
  44. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Can you please send me Pm with your logcat?


    This is no the error. Facebook message will be ignored (however you steel can share image) due to Facebook policy.
     
  45. Backward pieS

    Backward pieS

    Joined:
    Feb 7, 2013
    Posts:
    20
    I see. Oh, well, at least I know it doesn't need fixing! Thanks.
     
  46. Backward pieS

    Backward pieS

    Joined:
    Feb 7, 2013
    Posts:
    20
    I needed to split my Android game into an apk and an obb (just the main expansion file). So I added the "Google Play OBB Downloader" plugin to my project. I have merged the two AndroidManifest.xml files that came with that plugin and your plugin.

    Within the xml file, I know if I don't set "AndroidNativeBridge" to be the main/current activity, the social media functions won't work. But do you know if I won't be able to download the obb file if "UnityPlayerProxyActivity" is not set to be the main activity?

    I've been trying to test situations where the apk is downloaded, but the obb is not, so the obb needs to be downloaded by the game itself. So far I have not been able to get it to work.

    If I do need to both "UnityPlayerProxyActivity" and "AndroidNativeBridge" to have current activity status, I guess I need to set up additional code (I did see your guide here)...?
     
  47. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
  48. Krunchisoft

    Krunchisoft

    Joined:
    Jul 14, 2014
    Posts:
    22
    Hi there,just bought your plugin yesterday.It's awesome :)
    But i have a little problem.
    In My end game menu i have FB and twitter button.
    For some unknown reason, the FB button which include FB login and post screenshot playmaker action, it won't work
    until the game is restarted.But the twitter button works like a charm.
    any idea what is going on ?
    here's the link of my game on google play store :
    https://play.google.com/store/apps/details?id=com.AVIgameStudio.SteambotEscapeFree
     
  49. Krunchisoft

    Krunchisoft

    Joined:
    Jul 14, 2014
    Posts:
    22
    i also have problem when I tried to build to iOS. Screen Shot 2014-07-16 at 10.29.44 AM.png Screen Shot 2014-07-16 at 10.30.13 AM.png
    everything was okay before i implement the social plugin to my game.
    Thx.
     
  50. lacost

    lacost

    Joined:
    May 30, 2012
    Posts:
    1,708
    Thanks for report I will monitor log cat to find out what's wrong, and let you know ASAP


    Hello, please just follow set up guide. Few rules are changed, but I will add automatic check shortly.
    https://docs.google.com/document/d/..._06bk3weoVOOD-0nY/edit#heading=h.7qz6p4qlpkkd
    Cheers!
     
unityunity