Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Closed] Social Networking Plugin (Facebook and Twitter) live!

Discussion in 'iOS and tvOS' started by prime31, Sep 19, 2010.

  1. LordRyuuza

    LordRyuuza

    Joined:
    Aug 17, 2012
    Posts:
    5
    @prime31, I wasn't using graphRequest method to get the image, I was using a www instance, but I will change it to use fetchProfileImageForUsrId as you suggested, on the other hand, yes, I know that those methods are common, however, they are thrown when the reautorizeWithPublishPermissions is executed and then the game crash. The last thing it's shown are those methods only and the lldb prompt to execute some debug commands, the threads in execution and a window with assembler code (I can go step by step on it but it useless). If I press the play button again it continues to reload the game. If I execute the game outside Xcode, the game simply restarts.

    Thanks.
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @lord, that isn't a crash at all. That is iOS shutting down your app on exit.
     
  3. Eron198200

    Eron198200

    Joined:
    May 23, 2013
    Posts:
    8
    Error on xcode 5:

    ld: warning: directory not found for option '-L"/Users/utente/Desktop/Test/Libraries"'
    ld: library not found for -liPhone-lib
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @eron, not sure why you are posting in this thread. You are missing the Unity static library which has nothing to do with our plugins.
     
  5. Eron198200

    Eron198200

    Joined:
    May 23, 2013
    Posts:
    8
    When i build my app:



    Undefined symbols for architecture armv7:
    "__twitterShowOauthLoginDialog", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterPostStatusUpdateWithImage", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterLogout", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterIsTweetSheetSupported", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterIsLoggedIn", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterPostStatusUpdate", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterGetHomeTimeline", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookRestRequest", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookShowDialog", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookSetSessionLoginBehavior", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterLogin", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterInit", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterShowTweetComposer", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookShowFacebookComposer", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookReauthorizeWithPublishPermissions", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookGetFacebookAccessToken", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__sharingShareItems", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookInit", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookReauthorizeWithReadPermissions", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookLogout", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookRenewCredentialsForAllFacebookAccounts", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookLoginWithRequestedPermissions", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookGetSessionPermissions", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookIsLoggedIn", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookEnableFrictionlessRequests", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookIsFacebookComposerSupported", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookLoginUsingDeprecatedAuthorizationFlowWithRequestedPermissions", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterPerformRequest", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookGraphRequest", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterLoggedInUsername", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookGetAppLaunchUrl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__facebookCanUserUseFacebookComposer", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__twitterCanUserTweet", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  6. Eron198200

    Eron198200

    Joined:
    May 23, 2013
    Posts:
    8
  7. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
  8. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    I am trying to use the android social networking plugin and upon trying to login or post a message the game starts to goto FB but then a window pops up saying the game has shut down...:|

    Whats going on?
     
  9. truesoldersprit

    truesoldersprit

    Joined:
    Aug 23, 2013
    Posts:
    10

    Hi, prime31.

    How can I get the userId?
    Request and Passing code, can you teach me?
    Please help me.
    Thank you.
     
    Last edited: Oct 9, 2013
  10. jj-steele

    jj-steele

    Joined:
    Jul 24, 2012
    Posts:
    34
    Using the latest 04 Oct plugin - call FacebookBinding.init() the listener reports "Successfully logged in to Facebook", no other calls to FacebookBinding are sent, but almost immediately the message "the object that is being serialized [(null)] is not a valid JSON object" and the debugger kicks in.

    This is on iPhone 5 iOS 7.0.2
     
  11. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @truesolder, checkout the demo scene for an example of getting the userId. It has exactly that example in there.

    @jj-steele, please include a backtrace so that we have some data to work with.
     
  12. Thormor

    Thormor

    Joined:
    Nov 22, 2012
    Posts:
    39
    Quick question, was anyone able to do a "Like Page" feature in their game? I want the user to be directed to like the app page and once he did to receive a message ingame (or even maybe an achievement).
    The problem is, I am not sure how to get that without asking the user for all the pages he liked.

    I know some plugins were able to do that in the past (neatplug for instance). The user is not required to give the user_likes permissions. Only his basic ones.
     
  13. Thormor

    Thormor

    Joined:
    Nov 22, 2012
    Posts:
    39
    Also second, question. How can we parse the response from a graph request. For example I ask the liked pages...
    I can easily print it with the Prime31.Utils, but how can I loop through the data to get them...
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @thrmor, the logObject method dumps the data in JSON format. The JSON maps to List<object> and Dictionary<string,object> so what is printed there is just a Dictionary<string,object> with a "data" key that is a List of Dictionaries
     
  15. Thormor

    Thormor

    Joined:
    Nov 22, 2012
    Posts:
    39
    Got it! Nested Dictionary and List. Alright it will be a charm to parse it. Thanks sir!
     
  16. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    167
    Hello. I've got a fatal error on our iOS devices that causes a crash.

    You need to have a native FB account set up on your device and then go to iOS permission settings and disallow app's activity.

    Then, if you will try to call login() method, first time the application will throw an error and loginFailedEvent listener will be called. That is ok.
    But when you will try to login for the 2nd time (even after the application re-launch) the login will fail with crash. No error will be thrown to loginFailedEvent () listener:

    Code (csharp):
    1.  session creation error: Error Domain=com.facebook.sdk Code=2
    2. "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x17aa2250
    3. {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:SystemLoginDisallowedWithoutError,
    4. com.facebook.sdk:ErrorSessionKey=<FBSession: 0x177e92a0, state: FBSessionStateClosedLoginFailed,
    5. loginHandler: 0x0, appID: 275603189242237, urlSchemeSuffix: ,
    6.  tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x20a94c0>,
    7. expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0001-12-30 00:00:00 +0000,
    8. permissions:(null)>} userInfo: {
    9.     "com.facebook.sdk:ErrorLoginFailedReason" = "com.facebook.sdk:SystemLoginDisallowedWithoutError";
    10.     "com.facebook.sdk:ErrorSessionKey" = "<FBSession: 0x177e92a0, state: FBSessionStateClosedLoginFailed, loginHandler: 0x0, appID: 275603189242237, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x20a94c0>, expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(null)>";
    11. }
    12. (lldb)
    And that is bad. So, I can determine that session is invalid (using checkSessionValidityOnServer() method), but "invalid" reply is often treated as "need to relogin". And that causes a crash
     
    Last edited: Oct 17, 2013
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @soul, so, if I am understanding you are saying the steps to reproduce are:
    - login
    - logout via Settings.app
    - call checkSessionValidityOnServer
     
  18. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    167
    - login to FB account in native iOS settings app
    - go to settins -> Facebook -> and turn off permission swith corresponding to our game
    - run the game
    - call checkSessionValidityOnServer, get "false" reply
    - call login()
    - get loginFailedEvent event call (that is ok)
    - restart app (optional)
    - call checkSessionValidityOnServer, get "false" reply
    - call login() again
    - get a crush

    And after that, you will not get loginFailedEvent any more. Just crushes
     
  19. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    167
    PS: The same thing will happen if you just deny app's permission request (native iOS dialog) when it is shown for the first time.
     
  20. Illusionbug

    Illusionbug

    Joined:
    Oct 20, 2013
    Posts:
    2
    Anyone still encountered following issue with Prime31 Social Plugins when login Twitter Account,

    Login failed with following error message in Xcode, even with the demo scene,
    "Required oauth_verifier parameter not provided"

    Already updated with the latest Prime31 Plugins. Thanks.
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @illusion, are you using an ancient version of the plugin? Twitter didn't used to require the oauth_verifier about 6 - 9 months ago so the plugin didn't send it. Once Twitter started requiring it the plugin was updated to send it.
     
  22. Illusionbug

    Illusionbug

    Joined:
    Oct 20, 2013
    Posts:
    2
    Right, we brought Prime31 Social Plugins about 6 months ago. But we always update the plugins using Update Prime[31] Tools in Unity. If this is not proper way of updating your plugins, please advice how can we get the latest version.

    Thanks for your support.
     
  23. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @illusion, the "update prime[31] tools" menu updates the shared prime[31] tools. That has nothing at all to do with updating any specific plugin. You should follow the instructions on your original purchase receipt to update the actual plugin.
     
  24. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    Hi Prime,

    The latest social network plugin has issues with micro mscorlib stripping which I think comes from using certain reflection methods (specifically generics) in Json.decodeObject

    I can get around it by removing the offending code but is there any plans to fix it by not using the unsupported reflection methods? Will make life a lot easier not having to modify third party plugins. Thanks!
     
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @serious, you have two options: use a link.xml file to control stripping or do not use any methods that decode Json to classes.
     
  26. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    Hi Prime,

    As far as I know link.xml doesn't work with micro mscorlib stripping as it's using a heavily stripped down version of the core lib to begin with before the actual stripping happens.

    I don't use the new method that decodes json into structured objects as we have our own that does the same and works with micro mscorlib stripping. But since by default it's used in the Facebook class the build fails if I don't remove them. But then again I'd rather not having to modify third party lib which is hard to keep track of when doing updates.

    Just wondering if by default it should work with all stripping options and for advanced users they can choose to use it and understand that they are giving up micro mscorlib, not the other way round. Anyway, just a suggestion. Thanks.

    Edit:
    Regarding micro mscorlib stripping vs link.xml, check here with unity developer's response:
    http://forum.unity3d.com/threads/202701-blaklisting-micro-mscorlib
     
    Last edited: Oct 30, 2013
  27. nazgul

    nazgul

    Joined:
    Oct 24, 2011
    Posts:
    10
    Hello Prime!
    I need to post image on facebook wall using composer. But as I know, composer shows if user has logged in facebook via iOs settings.
    Everything is ok with Twitter. If user doesn't set up twitter in iOs settings, alert window pops up and asks me to add new twitter account .
    The question is: how to open iOs facebook settings from Unity?
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nazgul, the implementations for both are identical code except for the service. It could be an iOS feature where they only pop up the system alert for Twitter.
     
  29. morgyn

    morgyn

    Joined:
    Oct 22, 2013
    Posts:
    3
    prime31: We have recently updated the Plugin, and it works on other computers. However, my system continues to give me an error. I

    The error shown:

    ld: warning: instance method 'application:eek:penURL:sourceApplication:annotation:' in category from /Users/kffuser/Library/Developer/Xcode/DerivedData/Unity-iPhone-crlnkkxcpbmgkhclipinwttdkutk/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/AppController+UnityPlugin.o conflicts with same method from another category
    final section layout:
    __TEXT/__text addr=0x000030C0, size=0x01BD0D50, fileOffset=0x000020C0, type=1
    __TEXT/__picsymbolstub4 addr=0x01BD3E10, size=0x00003640, fileOffset=0x01BD2E10, type=27
    __TEXT/__stub_helper addr=0x01BD7450, size=0x000028D4, fileOffset=0x01BD6450, type=31
    __TEXT/__cstring addr=0x01BD9D30, size=0x000A32FE, fileOffset=0x01BD8D30, type=12
    __TEXT/__objc_methname addr=0x01C7D02E, size=0x00024A97, fileOffset=0x01C7C02E, type=13
    __TEXT/__objc_classname addr=0x01CA1AC5, size=0x0000272F, fileOffset=0x01CA0AC5, type=13
    __TEXT/__objc_methtype addr=0x01CA41F4, size=0x000068AC, fileOffset=0x01CA31F4, type=13
    __TEXT/__const addr=0x01CAAAA0, size=0x00093CD6, fileOffset=0x01CA9AA0, type=0
    __TEXT/__ustring addr=0x01D3E776, size=0x00000038, fileOffset=0x01D3D776, type=15
    __TEXT/__gcc_except_tab addr=0x01D3E7B0, size=0x00001848, fileOffset=0x01D3D7B0, type=0
    __DATA/__program_vars addr=0x01D40000, size=0x00000014, fileOffset=0x01D3F000, type=29
    __DATA/__nl_symbol_ptr addr=0x01D40014, size=0x0000115C, fileOffset=0x01D3F014, type=28
    __DATA/__la_symbol_ptr addr=0x01D41170, size=0x00000D90, fileOffset=0x01D40170, type=26
    __DATA/__mod_init_func addr=0x01D41F00, size=0x000006DC, fileOffset=0x01D40F00, type=32
    __DATA/__objc_classlist addr=0x01D425DC, size=0x00000638, fileOffset=0x01D415DC, type=0
    __DATA/__objc_nlclslist addr=0x01D42C14, size=0x00000008, fileOffset=0x01D41C14, type=0
    __DATA/__objc_catlist addr=0x01D42C1C, size=0x000000AC, fileOffset=0x01D41C1C, type=23
    __DATA/__objc_protolist addr=0x01D42CC8, size=0x00000190, fileOffset=0x01D41CC8, type=0
    __DATA/__objc_imageinfo addr=0x01D42E58, size=0x00000008, fileOffset=0x01D41E58, type=0
    __DATA/__objc_const addr=0x01D42E60, size=0x00034790, fileOffset=0x01D41E60, type=0
    __DATA/__objc_selrefs addr=0x01D775F0, size=0x0000500C, fileOffset=0x01D765F0, type=14
    __DATA/__objc_protorefs addr=0x01D7C5FC, size=0x0000001C, fileOffset=0x01D7B5FC, type=0
    __DATA/__objc_classrefs addr=0x01D7C618, size=0x0000080C, fileOffset=0x01D7B618, type=22
    __DATA/__objc_superrefs addr=0x01D7CE24, size=0x00000484, fileOffset=0x01D7BE24, type=0
    __DATA/__objc_data addr=0x01D7D2A8, size=0x00003E58, fileOffset=0x01D7C2A8, type=0
    __DATA/__cfstring addr=0x01D81100, size=0x00010030, fileOffset=0x01D80100, type=16
    __DATA/__const addr=0x01D91130, size=0x0001BD8C, fileOffset=0x01D90130, type=0
    __DATA/__objc_ivar addr=0x01DACEBC, size=0x0000189C, fileOffset=0x01DABEBC, type=0
    __DATA/__data addr=0x01DAE760, size=0x00057DF0, fileOffset=0x01DAD760, type=0
    __DATA/__objc_nlcatlist addr=0x01E06550, size=0x00000008, fileOffset=0x01E05550, type=0
    __DATA/__common addr=0x01E06800, size=0x0002F41C, fileOffset=0x00000000, type=24
    __DATA/__bss addr=0x01E35C20, size=0x00038CDC, fileOffset=0x00000000, type=24
    ld: b/bl/blx thumb2 branch out of range (-17149468 max is +/-16MB): from -[TwitterManager showViewControllerModallyInWrapper:] (0x01BC9D88) to __Z24UnityGetGLViewControllerv.island (0x00B6F09C) in '-[TwitterManager showViewControllerModallyInWrapper:]' from /_project/SlotUnity/Assets/Editor/SocialNetworking/Twitter/libP31Twitter.a(TwitterManager.o) for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  30. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @morgyn, that is an odd one. It looks like you may have some kind of conflict going on in there along with the linker failing. You may want to delete all the plugin files and the exported Xcode project and do a fresh build. Also run the Clean command in Xcode to ensure there are no cached object files lying around.
     
  31. Andre-Barbosa

    Andre-Barbosa

    Joined:
    May 3, 2013
    Posts:
    11
    Hi prime31,

    I have a similar linking error after updating to the latest version of the Social Networking plugin.

    I get "60 duplicate symbols for architecture armv7" all in the same file: Editor/SocialNetworking/Twitter/libP31Twitter.a

    I have completely removed the plugin from the project, reimported, deleted the xcode project, used the Clean command and it still happens.

    Any help?
     
  32. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @andre, if you are getting dupes you didnt delete all the old files. You should delete the entire Editor/SocialNetworking folder before importing the update.
     
  33. Andre-Barbosa

    Andre-Barbosa

    Joined:
    May 3, 2013
    Posts:
    11
    Thank you prime31.

    There were indeed some files left.
     
  34. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    Would appreciate some help with social plugin please, We have FB posts working just fine, but trying to get Deep Linking to work,( so clicking on our posts redirects users to the appropriate app store, or launches the app if they already have it installed. )
    Our facebook settings seem setup correctly, with app ID, bundle ID , sso enabled for both iOS and droid. Our app is not yet live in either droid or apple app store.
    The facebook docs are less than great, and we can't find any help on the forums here regarding deep linking.
    (we also tried using an app ID from a live game, as facebook docs suggest, to test the feature)

    But there is absolutely no behaviour that looks like deep linking. regardless of clicking on our post from iOS or droid device, it just goes to the original url we pass from the game.

    Anyone else managed to set this up and get it working ? Is there anything we need to do on the Unity side, or special way to login or auth ?
    Maybe we have to do a special kind of user login ?
    We just call Facebook.instance.postWhatever() and let the plugin take care of login and authentication, maybe this is the wrong way to go about things ?

    We also tried turning on deep linking for another of our existing live apps, just by editing facebook settings, but it has the same behavior. Is there a special login/Auth sequence required ?

    Any help appreciated, thanks in advance.
     
    Last edited: Nov 14, 2013
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @johnny, deep linking doesn't really have anything at all to do with the plugin code. The only relevant piece of information accessible via code is the getAppLaunchUrl method which provides the URL used to launch your app. All other setup happens on Facebooks servers.
     
  36. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    Thanks Prime. Appreciated. We'll keep messing around in FB settings.
     
  37. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    Hey there, I'm having an issue parsing the JSON that Facebook returns after a graph request. Here's my method below, which uses the code from the FacebookComboUI "Graph Request (me)" button as a template.

    You can see I've tried to pull three different values (id, first_name, and last_name) from the result of the request. The fName lName variables are using the same method that the FacebookComboUI button uses, which should point directly to a FacebookMeResult object with these values stored in its class variables. But when I print out them out to the debug text, it's totally blank. In order to parse it I tried to use the Json.decodeObject method as you can see on the id below, but that also prints out nothing at all.

    The worst part about this is not being able to use the debugger since I have to build to my device every time to test. Any ideas on how to actually get the JSON parsed correctly? Seems like it should be working like I have it, but there's definitely something wrong with my approach. I know that the request is correct because printing out the result string gives the entire JSON string.


    Code (csharp):
    1.     // called when a FB log-in is successful
    2.     public void FBLogInSuccess()
    3.     {
    4.         string userId = "";
    5.         string fName = "";
    6.         string lName = "";
    7.        
    8.         Facebook.instance.getMe( (error, result) =>
    9.             {
    10.                 // if we have an error we dont proceed any further
    11.                 if( error != null )
    12.                     debugText.text = error;
    13.    
    14.                 if( result == null )
    15.                     return;
    16.    
    17.                 // grab the userId and persist it for later use
    18.                 userId = Json.decodeObject<FacebookMeResult>(result).id; // spits out nothing
    19.                 fName = result.first_name; // also spits out nothing
    20.                 lName = result.last_name;
    21.            
    22.                 debugText.text += "\nMY Graph Request finished. Results: \n";
    23.                 debugText.text += result;
    24.             });
    25.        
    26.         debugText.text += "\nFacebook logged in successfully! Details:\n" + "ID: " + userId;
    27.     }
     
    Last edited: Nov 19, 2013
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @vvander, the getMe doesn't provide JSON in the completion handler. It provides a FacebookMeResult object.
     
  39. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    I did see this when looking at the source code for that method. For some reason, MonoDevelop believes the result variable to be a string though. Regardless, it allowed me to access the variables id, first_name, and last_name without complaining about syntax (though it does say "unresolved member"), but it's still not showing any data within those attributes.


    EDIT: Finally figured it out! It took quite a while, but I had a hunch it had to do with the timing of the completion handler. Turns out that these delegates act more like co-routines since they're run on a separate schedule to the rest of the main execution thread. Since my previous experience with delegates was only with short one-time-use functions I assumed they would execute sequentially (without going to the next statement in the larger function, FBLogInSuccess), but that's not the case. It's unintuitive at first, but hey that's lambdas for you I suppose.
     
    Last edited: Nov 21, 2013
  40. wmoscon

    wmoscon

    Joined:
    Dec 25, 2012
    Posts:
    5
    @prime I'm using the apprequest dialog and getting successful dialogCompletedWithUrlEvent callback (with a URL that contains all the user IDs I sent the request to) for some reason the user's aren't actually receiving it. Any idea why?

    Tks
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wmoscon, you will want to contact Facebook directly. We have no access to their servers and nothing to do with what happens on them. The plugin can only send the apprequest and return the result. What happens after that is 100% up to Facebook's servers.
     
  42. wmoscon

    wmoscon

    Joined:
    Dec 25, 2012
    Posts:
    5
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wmoscon, please post Android questions in the Android forum
     
  44. maskov1

    maskov1

    Joined:
    Nov 30, 2013
    Posts:
    2
    Dear @prime31,

    regarding your Social Network Plugin, we are concerned about Twitter integration and just want to make sure.

    Posting:
    1) Will be "public static event Action<bool> tweetSheetCompletedEvent;" fired automaticaly when "postStatusUpdate" method is used?
    2) In this case, will <bool> hold return value of postStatusUpdate meaning that we will known whether user sent or canceled?
    Following:
    3) Can we use method "public static void performRequest( string methodType, string path, Dictionary<string,string> parameters)" for Twitter Following directly from our application?
    4) Will be "requestDidFinishEvent" or "requestDidFailEvent" fired respectively?
    5) Or is there any other way how to Follow more easily using your Social Network Plugin?

    Thank you for answering these questions.
    Best Wishes
     
    Last edited: Nov 30, 2013
  45. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @maskov, 1. the tweetSheetCompletedEvent fires when the tweet sheet finishes. It has absolutely nothing to do with the postStatusUpdate method, which is just a regular Twitter API request and fires the normal requestDidFinishEvent.
    2. see previous answer.
    3. the performRequest method can be used for any method in the entire Twitter API.
    4. yes
    5. I am not sure I understand your question. Following someone with the performRequest method is one line of code. It can't be made any more simple...
     
  46. maskov1

    maskov1

    Joined:
    Nov 30, 2013
    Posts:
    2
    dear @prime31,

    thank you for answers, could you answer one more for us?

    we've bought your plugins and now (don't know why) we are having problems with posting twitter message... we are trying to post message with picture at the end, but we cannot post with normal length 140 characters as we would directly at twitter.com, twitter link should have 26 (27 with space) characters, therefore we are left with 114 (or 113)... unfortunately we have not been even able to post 89 character message (with added picture)... without picture we don't have any problem and as for fersion, we are using current one (downloaded yesterday)

    what to do?

    thank you and best regards
     
    Last edited: Dec 2, 2013
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @maskov, Twitter offers an API to fetch the length of a shortened URL. You should call that URL at least once per day and use that for your length calculations.
     
  48. VamshiKrishnaP

    VamshiKrishnaP

    Joined:
    Jan 17, 2013
    Posts:
    16
    Image Share in Twitter, am getting "test update from Unity!" message. how can i delete or edit the "test update from Unity!" message from Unity ?

    Reference : pic.twitter.com/oyl8CdYcZh
     
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @vamshi, just change the text to whatever you want when you call the postStatusUpdate method.
     
  50. LuckSound

    LuckSound

    Joined:
    Oct 5, 2013
    Posts:
    4
    Hi!
    I want to create login windiw in my game. When I try FacebookBinding.init() then it go to safari and restart my game. This is bad.
    Can I create login dialog like a shareDialog?