Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pip, no idea. If you can reproduce open a bug report with Unity.
     
  2. probbins

    probbins

    Joined:
    Oct 19, 2010
    Posts:
    216
    Hey Prime,

    Just a little correction, it no longer crashes or causes the AOT mscorlib error when launching. It just comes up with this warning in xcode.

     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pip, that is normal. Look about 3 lines down and you will see the method.
     
  4. probbins

    probbins

    Joined:
    Oct 19, 2010
    Posts:
    216
  5. probbins

    probbins

    Joined:
    Oct 19, 2010
    Posts:
    216
    Hey Prime,

    Just hoped you could help confirm this is a good way to go about posting on the walls, in terms of loggings, valid sessions and valid tokens.

    So in psudocode ~


    Startup

    1) initialise on start up.

    Posting to wall

    1) if session is not valid and permissions not set - login with permissions
    2) if session is not valid and permissions set - just log in
    3) wait for login successful callback if necessary
    4) post to wall with showDialog

    Do I need to be worried about getting tokens, token expiring or password changes?

    Thanks
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pip, you of course need to be concerned with tokens expiring. Face books documentation has some information you will want to go over with regard to session management.
     
  7. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    i'm going nuts with social networking plugin for Android
    anyone knows what to type on: "Android Class Name" on facebook page for the android settings?

    I typed in: com.unity3d.player.UnityPlayerProxyActivity
    but it doesn't seem to like it. I also tried adding my package name so:
    es.echoboom.dibudibu/com.unity3d.player.UnityPlayerProxyActivity
    and same luck, anyone knows what's looking for?
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @creat, leave it blank.
     
  9. e5an

    e5an

    Joined:
    Jul 6, 2012
    Posts:
    93
    {!} Assets/Scripts/SetupScript.js(557,29):BCE0019: 'isLoggedIn' is not a member of 'FacebookBinding'.

    Um. Wat?

    Says here that it is.
    I looked through the script and it looked like it is really facebookIsLoggedIn, but I tried it and that didn't work either.

    Why would I be getting this error? Are we not supposed to use FacebookBinding.isLoggedIn() now, and those docs are old?

    Here's how I got the error:

    if (FacebookBinding.isLoggedIn())
    {
    fbBoxRenderer.enabled = true;
    }
    else
    {
    fbBoxRenderer.enabled = false;
    }


    update: I just tried to work around this by checking FacebookBinding.getLoggedinUsersName(), and it's saying that doesn't exist either- same error. What is up with this?
     
    Last edited: Aug 15, 2012
  10. probbins

    probbins

    Joined:
    Oct 19, 2010
    Posts:
    216
    I'd love if someone could provide some assistance here. I am banging my head against a brick wall for a day and half.

    There seems to be a bug, if your token expires or do any action which causes your token to expire such as changing your password or deleting app permissions then things break.

    What seems to happen is that there is no way to tell if the token expires, and Facebook try to handle itself by asking you to login again but this causes a The operation couldn’t be completed. (NSURLErrorDomain error -999.) which is apparently caused because the showDialog was interrupted to show the authentication dialog. Now most stackoverflow, facebook bug submissions post that the fix is to filter it.

    Code (csharp):
    1.    
    2.  if (!(([error.domain isEqualToString:@"NSURLErrorDomain"]  error.code == -999) ||
    3.         ([error.domain isEqualToString:@"WebKitErrorDomain"]  error.code == 102))) {
    4.         [self dismissWithError:error animated:YES];
    5.     }
    6.  
    The code above is the apparent fix, which is adding the if error.code == - 999.

    This doesn't help though as the showDialog (feed / publish dialog) shows up but says "An error occurred. Please try again later." All subsequence attempts to post to wall results in the same error.

    I've tried doing /me pings to the server, getAppAccessToken, isValidSession, logging in each attempt, lots of other stuff. I've been googling the issue, reading the facebook documentation, stack overflows etc etc.

    I cant seem to find a way to stop the logging bug, or to check to see if the token is expired before doing a post to wall.

    Any help would be greatly appreciated!
     
  11. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Kiloblargh, the documentation is located here: http://prime31.com/unity/docs/#socialDoc and the proper method directly from the docs is isSessionValid. You do know that you can actually just open up the file and look at it's methods as well, right? The demo scene also has an example of using the method.

    @pip, if you just follow Facebook's best practices and extend the access token every launch you will never run into any issues.
     
  12. probbins

    probbins

    Joined:
    Oct 19, 2010
    Posts:
    216
    I do. This doesn't solve the issue of people changing their passwords, deleting app permissions or not playing the game for a extended amount of time.
     
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pip, sure it does. If you try to extend the access token and it fails you know that either it expired or the user made a change outside of your app that affected the access token. If it succeeds, then the access token is refreshed and you are good to go.
     
  14. probbins

    probbins

    Joined:
    Oct 19, 2010
    Posts:
    216
    Thanks Prime31.

    I was using it on application launch / resume, I'll put it in the code just before posting to wall.
     
  15. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    You can't, if you do so facebook returns this error:
    Error
    You have specified Android Package Name, but you did not specify Android Class Name. Launching a native Android application requires both.

    And if you leave the android package name empty, you can't use SSO and it won't be recognized as an android app.
     
    Last edited: Aug 15, 2012
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @creat, leave the package name blank as well. The plugin doesn't support SSO so it isn't required.
     
  17. e5an

    e5an

    Joined:
    Jul 6, 2012
    Posts:
    93
    Thanks, prime31. Now it's almost working but I am getting the same crash error Scott_dex was:

    My code is :

    switch (hit.transform.gameObject.tag)
    {
    case "FaceBook":
    if (FacebookBinding.isSessionValid())
    {
    FacebookBinding.showPostMessageDialog();
    }
    else
    {
    FacebookBinding.login();
    }

    When I call showPostMessageDialog(); it crashes the game with an EXC_BAD_ACCESS here:

    Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder:

    showPostMessageDialog() doesn't accept any strings as arguments, so it seems to be trying to find something internally to turn into a string, and failing.
     
  18. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @kilo, we can't reproduce what you are seeing using the demo scene from the latest version of the plugin. Can you post a full stack trace so we can look into it?
     
  19. e5an

    e5an

    Joined:
    Jul 6, 2012
    Posts:
    93
    I wanted to send this as a PM so as not to take up the whole page but I can't find the button for that

    fourdsnake`Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder:
    0x2971f4: mov r12, sp
    0x2971f8: push {r7, lr}
    0x2971fc: mov r7, sp
    0x297200: push {r4, r5, r6, r8, r10, r11, r12, lr}
    0x297204: sub sp, sp, #16
    0x297208: mov r11, sp
    0x29720c: mov r6, r0
    0x297210: mov r10, r1
    0x297214: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 40
    0x297218: b 0x297220 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 44
    0x29721c: rsceq r4, r5, r0, lsr #28
    0x297220: ldr r1, [pc, r1]
    0x297224: mov r0, r10
    0x297228: ldr lr, [r10]
    0x29722c: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x297230: mov r0, r6
    0x297234: ldr lr, [r6]
    0x297238: bl 0x299300 ; plt_string_ToCharArray
    0x29723c: mov r6, r0
    0x297240: mov r4, #0
    0x297244: b 0x297418 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 548
    0x297248: ldr r0, [r6, #12]
    0x29724c: cmp r0, r4
    0x297250: blls 0x297450 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 604
    0x297254: lsl r0, r4, #1
    0x297258: add r0, r6, r0
    0x29725c: add r0, r0, #16
    0x297260: ldrh r0, [r0]
    0x297264: strh r0, [r11]
    0x297268: cmp r0, #34
    0x29726c: bne 0x297290 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 156
    0x297270: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 132
    0x297274: b 0x29727c ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 136
    0x297278: rsceq r4, r5, r8, asr #27
    0x29727c: ldr r1, [pc, r1]
    0x297280: mov r0, r10
    0x297284: ldr lr, [r10]
    0x297288: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x29728c: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x297290: ldrh r0, [r11]
    0x297294: cmp r0, #92
    0x297298: bne 0x2972bc ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 200
    0x29729c: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 176
    0x2972a0: b 0x2972a8 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 180
    0x2972a4: rsceq r4, r5, r0, lsr #27
    0x2972a8: ldr r1, [pc, r1]
    0x2972ac: mov r0, r10
    0x2972b0: ldr lr, [r10]
    0x2972b4: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x2972b8: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x2972bc: ldrh r0, [r11]
    0x2972c0: cmp r0, #8
    0x2972c4: bne 0x2972e8 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 244
    0x2972c8: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 220
    0x2972cc: b 0x2972d4 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 224
    0x2972d0: rsceq r4, r5, r8, ror sp
    0x2972d4: ldr r1, [pc, r1]
    0x2972d8: mov r0, r10
    0x2972dc: ldr lr, [r10]
    0x2972e0: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x2972e4: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x2972e8: ldrh r0, [r11]
    0x2972ec: cmp r0, #12
    0x2972f0: bne 0x297314 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 288
    0x2972f4: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 264
    0x2972f8: b 0x297300 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 268
    0x2972fc: rsceq r4, r5, r0, asr sp
    0x297300: ldr r1, [pc, r1]
    0x297304: mov r0, r10
    0x297308: ldr lr, [r10]
    0x29730c: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x297310: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x297314: ldrh r0, [r11]
    0x297318: cmp r0, #10
    0x29731c: bne 0x297340 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 332
    0x297320: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 308
    0x297324: b 0x29732c ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 312
    0x297328: rsceq r4, r5, r8, lsr #26
    0x29732c: ldr r1, [pc, r1]
    0x297330: mov r0, r10
    0x297334: ldr lr, [r10]
    0x297338: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x29733c: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x297340: ldrh r0, [r11]
    0x297344: cmp r0, #13
    0x297348: bne 0x29736c ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 376
    0x29734c: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 352
    0x297350: b 0x297358 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 356
    0x297354: rsceq r4, r5, r0, lsl #26
    0x297358: ldr r1, [pc, r1]
    0x29735c: mov r0, r10
    0x297360: ldr lr, [r10]
    0x297364: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x297368: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x29736c: ldrh r0, [r11]
    0x297370: cmp r0, #9
    0x297374: bne 0x297398 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 420
    0x297378: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 396
    0x29737c: b 0x297384 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 400
    0x297380: .long 0x00e54cd8 ; unknown opcode
    0x297384: ldr r1, [pc, r1]
    0x297388: mov r0, r10
    0x29738c: ldr lr, [r10]
    0x297390: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x297394: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x297398: ldrh r5, [r11]
    0x29739c: ldrh r0, [r11]
    0x2973a0: cmp r0, #32
    0x2973a4: blt 0x2973c4 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 464
    0x2973a8: cmp r5, #126
    0x2973ac: bgt 0x2973c4 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 464
    0x2973b0: mov r0, r10
    0x2973b4: ldrh r1, [r11]
    0x2973b8: ldr lr, [r10]
    0x2973bc: bl 0x299530 ; p_90
    0x2973c0: b 0x297414 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 544
    0x2973c4: ldr r0, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 472
    0x2973c8: b 0x2973d0 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 476
    0x2973cc: smlaleqr4, r5, r0, r12
    0x2973d0: ldr r0, [pc, r0]
    0x2973d4: str r0, [r11, #8]
    0x2973d8: mov r0, r5
    0x2973dc: mov r1, #16
    0x2973e0: bl 0x299540 ; plt_System_Convert_ToString_int_int
    0x2973e4: mov r3, r0
    0x2973e8: mov r1, #4
    0x2973ec: mov r2, #48
    0x2973f0: ldr lr, [r3]
    0x2973f4: bl 0x299550 ; p_92
    0x2973f8: mov r1, r0
    0x2973fc: ldr r0, [r11, #8]
    0x297400: bl 0x2990a0 ; p_17
    0x297404: mov r1, r0
    0x297408: mov r0, r10
    0x29740c: ldr lr, [r10]
    0x297410: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x297414: add r4, r4, #1
    0x297418: ldr r0, [r6, #12]
    0x29741c: cmp r4, r0
    0x297420: blt 0x297248 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 84
    0x297424: ldr r1, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 568
    0x297428: b 0x297430 ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 572
    0x29742c: rsceq r4, r5, r0, lsl r12
    0x297430: ldr r1, [pc, r1]
    0x297434: mov r0, r10
    0x297438: ldr lr, [r10]
    0x29743c: bl 0x299470 ; plt_System_Text_StringBuilder_Append_string
    0x297440: add sp, r11, #16
    0x297444: pop {r4, r5, r6, r8, r10, r11}
    0x297448: ldr r7, [sp, #8]
    0x29744c: ldm sp, {sp, pc}
    0x297450: mov r1, lr
    0x297454: ldr r0, [pc] ; Prime31_MiniJSON_serializeString_string_System_Text_StringBuilder + 616
    0x297458: bl 0x299020 ; plt__jit_icall_mono_arch_throw_corlib_exception
    0x29745c: andeq r0, r0, #123731968
     
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Does the demo scene produce the same result?
     
  21. e5an

    e5an

    Joined:
    Jul 6, 2012
    Posts:
    93
    Seems not to; and I switched to showPostMessageDialogWithOptions anyway, I think my app was not registered fully or properly on Facebook's developer site and that was what caused the error.
     
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Important Announcement

    It's time to head on out to Unite '12 in Amsterdam. If you will be going to Unite bring your questions with you (either plugin related or general Unity questions) and find me in the labs. prime31 t-shirts will be given away to whoever finds me first! Any questions posted in the forum from today onward we cannot guarantee will get answered until we return on the 29th. Internet access will be limited so in the meantime read the documentation and look back for similar questions in the forum topic to find a solution.
     
  23. gadgetoflife

    gadgetoflife

    Joined:
    Aug 11, 2012
    Posts:
    4
    Hi!

    I have Xcode 4.4.1 and i am on Mountain Lion. I am using Prime31 iOS Social Networking plugin 1.4.3 with unity 3.5.3. I integrate with QCAR plugin following the steps listed in Prime31 Unity Plugins Officially Live!:

    - import QCAR
    - rename PostprocessBuildPlayer to PostprocessBuildPlayer_QCAR
    - import any prime31 plugin
    - build and replace

    However i get the error:

    Error
    ld: Unable to insert branch island. No insertion point available. for architecture armv6
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Please help. Thank you.
     
  24. chuckjones

    chuckjones

    Joined:
    Aug 21, 2012
    Posts:
    1
    Hello Prime -

    Having an issue with permissions posting to the the my timeline once authentication and logged in.

    The login credentials seem to be function properly, but when I try to post I get the error from Facebook:


    error: message: (#200) The user hasn't authorized the application to perform this action
    type: OAuthException
    code: 200


    Code (csharp):
    1.  
    2. if(GUI.Button(new Rect(10,10,200,200),"Facebook Login")){
    3.            
    4.             Debug.Log ("login binding");
    5.             FacebookBinding.init ("xxxxxxxx");
    6.             FacebookBinding.login();
    7.            
    8.         }
    9.        
    10.         if(GUI.Button(new Rect(220,10,200,200),"Post Message")){
    11.  
    12.             Debug.Log ("Post -'Please ignore' on my timeline");
    13.            
    14.             Facebook.instance.postMessage ("test", completionHandler);
    15.            
    16.             Debug.Log ("Finished posting -'Please ignore' on my timeline");
    17.            
    18.         }
    19.        
    20.         if(GUI.Button(new Rect(430,10,200,200),"Logout")){
    21.  
    22.             FacebookBinding.logout ();
    23.            
    24.         }
    25.     }
    26.  
    Thanks,
    Rob.
     
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @chuck, you can't just post on someone's behalf without requesting the appropriate permissions. Check Facebooks docs for the required permissions.
     
  26. DavidRDev

    DavidRDev

    Joined:
    Jul 19, 2012
    Posts:
    47
    Hello!

    When posting links/images from facebook everything seems fine if you do not have the Facebook App installed. If you do have the Facebook App installed it opens up the app and then comes back immediately to the application without fully opening it with the dialog box. It all seemed to work nicely until Aug 20th(with Facebook App installed). All App IDs match and our facebook account seems to have all of its information setup correctly. Any ideas/clues?
     
  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @denko, ensure that you properly setup your bundle ID in the Facebook web portal and that you are using the matching provisioning profile. Facebook will not authenticate a user unless it matches. You also must enable SSO in their web portal.
     
  28. DavidRDev

    DavidRDev

    Joined:
    Jul 19, 2012
    Posts:
    47
    Just checked, everything is OK. We recently changed our provisioning profile though this is when our "issues" started happening, at least according to someone. Could it be possible that the build process is messing with this?

    Code (csharp):
    1.        
    2.                if(TwitterBinding.isTweetSheetSupported())
    3.         {
    4.             TwitterBinding.showTweetComposer( _postText, _imageURL );
    5.         }
    6.         else
    7.         {
    8.             EtceteraBinding.showActivityView();
    9.             TwitterBinding.postStatusUpdate(_postText,_imageURL);
    10.         }
    11.  
    Also if I use this code non-tweet sheet twitter postings will fail. If I use CanUserTweet() instead of isTweetSheetSupported() non-tweet sheet postings will only execute once and after that it will always fail. I assume this happens because TweetSheet IS supported but an account in the settings hasn't been setup? Is it still possible to use the previous non-iOS5 Twitter at that point?

    Thanks for the help in advance :)
     
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @denko, the post process scripts will never touch anything to do with code signing. You can definitely drop back to the non-tweet sheet Twitter system if the user is on iOS < 5 or doesn't have an account setup.
     
  30. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello Prime31,

    I'm using the Social Networking plugin and I can't get the Facebook login to appear. When I call:

    Code (csharp):
    1. var permissions = new string[] { "publish_actions", "user_games_activity" };
    2.             FacebookAndroid.loginWithRequestedPermissions( permissions );
    I get a blank white screen over my game, nothing else happens.

    I also can't get the Twitter login to appear when I call:

    Code (csharp):
    1. TwitterAndroid.showLoginDialog();
    Nothing happens at all. No new screen or anything.

    Thanks,

    JL
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @crazy, first off please post Android questions in the Android forum to keep this on topic. Are you following along with the demo scenes and calling init with a legit, properly setup app ID (Facebook) or consumer key/secret (Twitter)? Nothing will work unless you setup your apps on Facebook and Twitters website and properly call init with the information from the apps.
     
  32. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Sorry about posting here, I thought I was in the Android section. I guess I'm just used to hanging out in the iOS area!

    So, I'll move my question there.
     
  33. DarkJedi

    DarkJedi

    Joined:
    Apr 15, 2009
    Posts:
    48
    Hi Mike,

    Has FacebookBinding.extendAccessToken now been depreciated? I've just downloaded the most recent SocialNetworking plugin and noticed that's missing from FacebookBinding (but the events are still in FacebookManager)

    If so, what's the new accepted wisdom for extending (or otherwise) tokens?

    Thanks!
    Dan
     
  34. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dark, the new Facebook SDK no longer has the method. You can still call it directly using the Graph API though.
     
  35. DarkJedi

    DarkJedi

    Joined:
    Apr 15, 2009
    Posts:
    48
    Ah brilliant, thanks.
     
  36. BenNewell

    BenNewell

    Joined:
    Sep 4, 2012
    Posts:
    1
    Nevermind, found my answer.
     
    Last edited: Sep 4, 2012
  37. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @Prime31

    Evening prime.

    We've just integrated the Social Networking stuff into our ios builds and we're getting a few issues.

    1) We noticed that the GameCenter kit and the Social Kit both use the same JSONKit.h and .m files which was causing a duplicate symbol error.
    2) After removing the duped JSONKit files we got a litte further in the build but are now seeing this duplicate issues...

    Code (csharp):
    1.  
    2.  
    3. ld: duplicate symbol _OBJC_CLASS_$_SBJSON in /Users/b_pritchard/Desktop/iOS/SocialNetworking/FacebookSDK/libFacebookSDK.a(SBJSON.o) and /Users/b_pritchard/Library/Developer/Xcode/DerivedData/Unity-iPhone-hkdkynyhjvsmxlcowdhmfltglxob/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/SBJSON.o for architecture armv7
    4. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    5.  
    6.  
    We're using quite a few of your plugins.. love them all. :) Would you have any advice on clearing out duplicates across multiple plugins?

    Cheers
    Bryan
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, JSONKit is what we use for our stuff. It is super easy to deal with: just delete one copy of the JSONKit.h/m file if you get duplicate errors. SBJSON is the work of the devil and not our doing. Many SDK's use it and they are pretty much all using different versions of it. There is no hard and fast rule to fixing it. In the case of Facebook where it is compiled into a static library the usual way to go about fixit it is to remove any SBJSON implementation files (*.m) and leave the header files (*.h) in place doing a Clean then Build after each deletion until it compiles.

    Side note/rant: I complain to every one of the SDK vendors about using SBJSON without properly namespacing it to avoid clashes. A few have finally started namespacing things but most wont bother.
     
  39. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31

    Ok thanks for the heads up... we are using a marketing plugin suite from a customer that uses what appears to be the entire json library. Fingers crossed its a straight usage and not a bunch of custom functions... stepping through now. :)

    Cheers
    Bryan
     
  40. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31

    after having spent most of this night on it, i've had to remove all the socialNetworking stuff.. the sbjson stuff is creating far too many conflicts. unfortunately i can't remove the customer plugins as they are too critical to the application.
     
  41. serioustommy

    serioustommy

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

    I'm currently having problem logging out with FacebookBinding.logout().

    What happens is that after calling logout, any subsequent FacebookBinding.Login(premissions) just succeeds without prompting the users to login. We're currently trying to handle the case where the users change their password by checking if the access token is valid before using it but this doesn't seem possible currently because we can't invalidate the cached token.
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @serious, by default tokens are not expired by logging out. You can change this behavior by modifying the logout function in the FacebookManager.mm file. It has an alternate path commented out that will kill the token.
     
  43. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    Ah great thanks that works. Is it possible to have a boolean toggle as a parameter in the logout method to kill the token in the future update? I'm always worried about having to keep track of small changes to an external library when updating.
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @serious, we will look into adding it.
     
  45. rextr09

    rextr09

    Joined:
    Dec 22, 2011
    Posts:
    416
    Does anyone use the Social Plug-In with JavaScript without any problem? Is there anything C# specific? Just want to be sure before buying..
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @rextr, all of our plugins will work fine from UnityScript. Do note that many of them use standard language features such as generics and events so be sure you know how to use your language properly.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We have a Facebook friends scoreboard in our almost finished first iOS title. It works so far. We would like to put the profile picture of each friend in the scoreboard. It seems that we will have to retrieve the friends' pictures one-by-one, which is irritating. Anyway, that's reality. I'm wondering what I need to do with those images in order to actually use them. Do I need to save them to the iPhone to a special folder, and/or create a texture dynamically somehow so I can assign it to prefabs? I'm hoping to do this in a way that will not have to re-fetch the same images all the time.

    Has anyone done this? It's a very very common thing on iOS games, although I don't know if any of them were made with Unity.

    Thanks!
    -Brian
     
  48. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jerotas, you just need to save the images to disk and use the standard WWW class to load the files into textures.
     
  49. gregdevice

    gregdevice

    Joined:
    Feb 8, 2009
    Posts:
    11
    Hi, just getting started using your plugins. Regarding the Social Networking Plugin in Unity iPhone, is there supposed to be a SocialNetworkingManager.prefab or SocialNetworkingManager.cs provided? I'm using some example scripts that call for that but I don't see it in the install. Just uninstalled and re-downloaded/installed and I still don't see anything. I have the Facebook and Twitter prefabs and scripts. Just making sure before I go down the wrong alley. Thanks!
     
  50. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gregdevice, it is in the Plugins/SocialNetworking/FacebookCommon folder: