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
  4. Dismiss Notice

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

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

  1. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    742
    just login to facebook with your (facebook developer approved) facebook account, and look at the wall. The image or post will be there.
    (also make the post with the approved facebook developer or test account)
     
  2. MikeCoderMore

    MikeCoderMore

    Joined:
    Sep 22, 2013
    Posts:
    61
    ok i was missing the completionHandler, Awesome service! thanks for the extremely fast replays guys thats sorted it
     
  3. Anathorn

    Anathorn

    Joined:
    Oct 1, 2012
    Posts:
    5
    Hi, i have two questions, i am receiving the following error when i login in some iPhone devices:

    Mar 14 17:51:10 accountsd[83] <Notice>: 2014-03-14 17:51:10.013 accountsd[83:27003]: No Facebook accounts. Rejecting access request.


    1) Is there any way to fix this??

    2) I thought about using Prime31 only with Webview but i dont know of there is any way to do that.
    If the Native Facebook app is installed can i ignore it and use only the webview login?

    Thanks!
     
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @anathorm, 1. You can't fix the fact that the device has no native Facebook accounts. Only the device owner can add Facebook accounts.
    2. The setSessionLoginBehavior method lets you control the way the Facebook SDK logs the user in.
     
  5. Anathorn

    Anathorn

    Joined:
    Oct 1, 2012
    Posts:
    5
    Do i have to call this method when i initialize the FacebookBinding class?
     
    Last edited: Mar 14, 2014
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @anathorn, you have to call it sometime before you log the user in.
     
  7. Anathorn

    Anathorn

    Joined:
    Oct 1, 2012
    Posts:
    5
    Great! i could make it work, thanks a lot Prime!!! :)
     
  8. SyncInteractive

    SyncInteractive

    Joined:
    Mar 17, 2014
    Posts:
    12
    Hi Prime,

    Just had a crash when calling TwitterBinding.showLoginDialog(); on iOS.

    2014-03-17 11:57:57.250 Urenco[5219:60b] +[P31 unityViewController]: unrecognized selector sent to class 0x1d4e920
    2014-03-17 11:57:57.252 Urenco[5219:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[P31 unityViewController]: unrecognized selector sent to class 0x1d4e920'
    *** First throw call stack:
    (0x301d0fd3 0x3ae85ccf 0x301d4873 0x301d3253 0x301227f8 0x1bb65e1 0x1bb689d 0x151d8fc 0x908f8 0x571b8 0x13dadf8 0x198b9bc 0x1a1c218 0x16dddb4 0x16ddf3c 0x16b88c4 0x16b900c 0x16b91a0 0x16bc8c4 0x1530690 0xc404 0xc354 0x32f5a57 0x3283dc03 0x3283d9ad 0x355f175d 0x30f16591 0x30190ef9 0x3019bab7 0x3019ba53 0x3019a227 0x30104f4f 0x30104d33 0x351ca663 0x32bd4f95 0xf0f8 0x8408)
    libc++abi.dylib: terminating with uncaught exception of type NSException

    Have no idea how this has come about? this is from the Test Scene of the plugin.
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sync, that looks like an old version of the plugin. Some things in Unity changed a bit. Delete the old files in the Editor/Prime31Shared folder and reimport the latest version.
     
  10. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    Our test iPhone seems to have broken, so we're stuck using the simulator until we can get another one ready. Unfortunately, it looks like the Prime31 social plugin is having some problems with building to the iOS simulator. When Unity builds the project targeting the simulator it sets the targeted architecture to i386 (for the simulator), for which apparently some of the P31 social plugin files don't have any "defined symbols".

    Any idea how to get the social plugin to work with the iOS simulator? As an aside, I tried removing the -all_load build flag since that was the source of some other Mach-O errors on another plugin we're using, but that didn't seem to change anything.

    Here's the error log:

    Code (csharp):
    1.  
    2. ld: warning: ignoring file /Users/Michael/Desktop/iOS build 4 (v1.0.4)/Libraries/libSoomlaiOSRoadsterRelease.a, missing required architecture i386 in file /Users/Michael/Desktop/iOS build 4 (v1.0.4)/Libraries/libSoomlaiOSRoadsterRelease.a (2 slices)
    3. ld: warning: ignoring file /Users/Michael/Desktop/Jetpack Game/Assets/Editor/Prime31Shared/libP31SharedTools.a, missing required architecture i386 in file /Users/Michael/Desktop/Jetpack Game/Assets/Editor/Prime31Shared/libP31SharedTools.a (2 slices)
    4. ld: warning: ignoring file /Users/Michael/Desktop/Jetpack Game/Assets/Editor/SocialNetworking/FacebookSDK/libfacebook_ios_sdk.a, missing required architecture i386 in file /Users/Michael/Desktop/Jetpack Game/Assets/Editor/SocialNetworking/FacebookSDK/libfacebook_ios_sdk.a (2 slices)
    5. ld: warning: ignoring file /Users/Michael/Desktop/Jetpack Game/Assets/Editor/SocialNetworking/Twitter/libP31Twitter.a, missing required architecture i386 in file /Users/Michael/Desktop/Jetpack Game/Assets/Editor/SocialNetworking/Twitter/libP31Twitter.a (2 slices)
    6. Undefined symbols for architecture i386:
    7.   "_OBJC_CLASS_$_FBAppCall", referenced from:
    8.       objc-class-ref in FacebookManager.o
    9.   "_OBJC_CLASS_$_FBAppEvents", referenced from:
    10.       objc-class-ref in FacebookManager.o
    11.   "_OBJC_CLASS_$_FBDialogs", referenced from:
    12.       objc-class-ref in FacebookBinding.o
    13.       objc-class-ref in FacebookManager.o
    14.   "_OBJC_CLASS_$_FBFrictionlessRecipientCache", referenced from:
    15.       objc-class-ref in FacebookManager.o
    16.   "_OBJC_CLASS_$_FBRequest", referenced from:
    17.       objc-class-ref in FacebookManager.o
    18.   "_OBJC_CLASS_$_FBRequestConnection", referenced from:
    19.       objc-class-ref in FacebookManager.o
    20.   "_OBJC_CLASS_$_FBSession", referenced from:
    21.       objc-class-ref in FacebookManager.o
    22.   "_OBJC_CLASS_$_FBSettings", referenced from:
    23.       objc-class-ref in FacebookManager.o
    24.   "_OBJC_CLASS_$_FBShareDialogParams", referenced from:
    25.       objc-class-ref in FacebookBinding.o
    26.   "_OBJC_CLASS_$_FBWebDialogs", referenced from:
    27.       objc-class-ref in FacebookManager.o
    28.   "_OBJC_CLASS_$_P31", referenced from:
    29.       objc-class-ref in FacebookBinding.o
    30.       objc-class-ref in FacebookManager.o
    31.       objc-class-ref in TwitterBinding.o
    32.      (maybe you meant: _OBJC_CLASS_$_P31Unity)
    33.   "_OBJC_CLASS_$_TwitterManager", referenced from:
    34.       objc-class-ref in TwitterBinding.o
    35. ld: symbol(s) not found for architecture i386
    36. clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Thanks for your help!
     
  11. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @vvander, , Unity does not support plugins in the simulator
     
    furic likes this.
  12. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    Ah, good to know. Thanks for your help!
     
  13. Conflei

    Conflei

    Joined:
    Apr 21, 2013
    Posts:
    44
    Hey did you solve it? I'm having the same issue.
     
  14. xikky

    xikky

    Joined:
    Dec 11, 2012
    Posts:
    47
    Hi Prime, I'm having an Apple Mach-O Linker Error and it seems (to my small knowledge) that the issue is occurring from TwitterManager.

    $apple mach-o.png

    I thoroughly searched google with many of the results pointing out to change some Build Settings in Xcode, which I tried with no success.

    Do you have any ideas how I can solve this?

    Thank you!
     
  15. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @xikky, that looks like an old version of the plugin. Update to the latest for compatibility with recent Unity versions and be sure to do as the release notes suggest: delete all old files before importing the update.
     
  16. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    Is it possible to tag someone when posting with your plugin?
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @unitynewb, the plugin exposes the entire Graph API so if it is possible with the Graph API it can be done with the plugin.
     
  18. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    it looks like I can use message_tags, but that is suppose to be an object, and your POST requires a dictionary with a string value. I tried changing your code so the dictionary was <string,object>, but that didn't work. I created the message_tags object using a Dictionary.
    Code (csharp):
    1.  
    2. var tags = new Dictionary<string,object>
    3.             {
    4.                 { "id", challengeid },
    5.                 { "name", challengename },
    6.                 { "type", "user" },
    7.                 { "offset", 0 },
    8.                 { "length", 5 }
    9.             };
    10.  
    11.  
    12.             var parameters = new Dictionary<string,object>
    13.             {
    14.                 { "link", "LINKHERE" },
    15.                 { "name", "NAMEHERE" },
    16.                 { "picture", "LINKTOIMAGE" },
    17.                 { "message_tags", tags },
    18.                 { "caption", "CAPTIONHERE" }
    19.             };
    20.             FacebookAndroid.showDialog( "stream.publish", parameters );
    21.  
    It does POST the message, but does not tag the user.
     
  19. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    I realized that you have to put tags in its own array of tags, but I still couldn't get it to work. I'll play around with it more later:
    Code (csharp):
    1.  
    2.  
    3. var tags = new Dictionary<string,object>
    4.             {
    5.                 { "id", challengeid },
    6.                 { "name", challengename },
    7.                 { "type", "user" },
    8.                 { "offset", 0 },
    9.                 { "length", 5 }
    10.             };
    11.             var message_tags = new List<object>
    12.             {
    13.                 { tags}
    14.             };
    15.             var parameters = new Dictionary<string,object>
    16.             {
    17.                 { "link", "LINK" },
    18.                 { "name", "NAME" },
    19.                 { "picture", "LINKTOIMAGE" },
    20.                 { "message_tags", message_tags },
    21.                 { "caption", "CAPTION" }
    22.             };
    23.             FacebookAndroid.showDialog( "stream.publish", parameters );
    24.  
     
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @unitynewb, you can't pass objects to a dialog. You have to use the Graph API via the graphRequest method.
     
  21. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    Looks like its not possible anyway using their API:
    https://developers.facebook.com/bugs/351412111599830

    You can only read message_tags at the moment. I guess I should have scrolled up in the facebook API page and read the big bolded line that says Reading
     
  22. Peppercat

    Peppercat

    Joined:
    Oct 23, 2012
    Posts:
    6
    Hi Mr. Prime! I'm upgrading an old Unity Project and included your last version of this plug-in. But I've got this exception when trying to run it on device.

    I had a previous version of the plug-in loaded in Unity, and I just imported the new package without deleting the previous one. could this be the problem? The XCode project is a completely new build, thoug. Thanks!
     
  23. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @peppercat, anytime the release notes tell you to remove old files before importing it is a good idea to do so. That note is in there whenever a major underlying SDK change occurs and you will run into conflicts if you don't do what it says.
     
  24. Peppercat

    Peppercat

    Joined:
    Oct 23, 2012
    Posts:
    6
    Ok, I cleaned my project form the entire plug-in and re-imported it, and now it works perfectly. Thank you!

    EDIT: Ok, on a completely different problem, the Facebook post works like a charm in iOS7, but it's failing in iOS6. does the Plug-in works only on iOS7? What am I doing wrong?

    The error looks like:

    Maybe I should be more explicit.

    I have an application which is using, basically, the methods

    The game shows me a dialog asking me my FB username and password, but when I give it the data and try to connect, the above mentioned error log appears. It only happens in iOS 6, iOS 7 facebook publication works perfectly. I have noticed that some of the frameworks i added in order to make Social Networking Plugin work must be setted as "optional" in the XCode Build Phases section of the project to run it in an iOS6 device, so I suppouse there's the key of the problem. Am I right? Thanks in advance!
     
    Last edited: Apr 9, 2014
  25. Peppercat

    Peppercat

    Joined:
    Oct 23, 2012
    Posts:
    6
    Ok, solved. Changed Social.framework and Account.framework to "Required", then clean and build and it worked. No idea of why does this work this time (since both frameworks are available in iOS6, they should have been loaded even when they were stated as "Optional"), but it's working now and that's all that matters. Thanks anyway.
     
    Last edited: Apr 9, 2014
  26. drjamiearron

    drjamiearron

    Joined:
    Jun 8, 2012
    Posts:
    132
    Hi there,

    I'm interested in purchasing this plugin as the official SDK is causing me a lot of grief at present. Apologies if this has been asked previously, but I noticed your plugins primarily target mobile devices. If I were to use your social plugin, will everything function correctly within the Facebook canvas (i.e. a webplayer build)?
     
  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jamez, our plugin is totally native code and will only work on an actual mobile device.
     
  28. drjamiearron

    drjamiearron

    Joined:
    Jun 8, 2012
    Posts:
    132
    Hey Prime, thanks for getting back to me.

    Fair enough. If I may, I just have one more question:

    As far as I'm aware (assuming I'm doing things correctly) the Facebook SDK doesn't allow me to test the actions (posting, sharing, inviting, etc) on the actual device itself - It just doesn't seem to work. We already have an inactive app created on Facebook. By using your plugin, can we test everything on the device, or can it only be tested in the editor whilst in development?
     
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jamez, you cannot test aspects that require Android/iOS in the editor such as authentication, native dialogs, etc. You can test any and all Graph API calls right in the editor though.
     
  30. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    What is the proper way to include a local screenshot with FacebookBinding.ShowDialog() rather than an external url :

    Code (csharp):
    1.  
    2.  
    3.             var parameters = new Dictionary<string,string>
    4.             {
    5.                 { "link", "http://prime31.com" },
    6.                 { "name", "link name goes here" },
    7.                 { "picture", "http://prime31.com/assets/images/prime31logo.png" },
    8.                 { "caption", "the caption for the image is here" }
    9.             };
    10.             FacebookBinding.showDialog( "stream.publish", parameters );
    11.  
    12.  
    This is what I'm currently using:

    Code (csharp):
    1.  
    2.                 var pathToImage = Application.persistentDataPath + "/" + FacebookGUIManager.screenshotFilename;
    3.                 if( !System.IO.File.Exists( pathToImage ) )
    4.                 {
    5.                     Debug.LogError( "there is no screenshot avaialable at path: " + pathToImage );
    6.                     return;
    7.                 }
    8.                    
    9.                 var bytes = System.IO.File.ReadAllBytes( pathToImage );
    10.                 Facebook.instance.postImage( bytes, "im an image posted from iOS", completionHandler );
    11.  
    12.  
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @ressgrant, dialogs do not support local images. You have to use the postImage method to post a local image to Facebook.
     
  32. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    Prime31, thanks for the quick response. The only reason I want to do it this way is so the user has a kind of warning or feedback that something is happening. With postimage(), there is no feedback to the user that anything will be posted, it just occurs behind the scenes. Is there a way to have some kind of feedback to inform the user that something will be posted? Similar to how ShowDialog brings up a separate window?
     
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @reiss, the postImage method uses the Graph API which has no UI associated with it. You can of course create UI yourself to match your game much like the showDialog method and display it before posting.
     
  34. joshua-jebadurai

    joshua-jebadurai

    Joined:
    Jul 3, 2009
    Posts:
    14
    Just got Prime31 iOS Social Networking Plugin v3.6.2. I set it up properly and it works on the device flawless but on the editor it does nothing, the platform is set to iPhone, iPod touch and iPad.

    The plugin doesn't allow to test in Unity editor?
     
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @joahua, all of our plugins are true, native code plugins. Native code can only run on the operating system it was written for. You cannot run iOS code anywhere but on an iOS device.
     
  36. valmin

    valmin

    Joined:
    Apr 30, 2014
    Posts:
    3
    Hi!

    I try to use your Social Network Plugin for iOS to post picture to the twitter. I invoke method TwitterBinding.init with consumer_key and consumer_secret. Than I invoke TwitterBinding.showLoginDialog() and my project freezes. Looks like it is waiting for something.
    I checked what happens in device's log. After I invoke TwitterBinding.showLoginDialog() just one line is shown in log:

    2014-04-30 17:33:22.941 PocketPuppy[32299:907] got reqeust token

    Do you have any ideas why it can happens?

    I uses Unity 4.3. Version of the plugin 3.6.2 (the last one).
    Device for testing iPhone 4 with iOS 6.1

    Thank you
     
  37. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @valmin, without a full backtrace I can't say what is happening. Please provide the entire backtrace
     
  38. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    Hey there, I'm experiencing a sudden crash while in the middle of parsing a graph request from Facebook. It happens every time at the same place, and because of the timing and log content (below) I thought it would be good to post here.

    Every other feature we've been using in the plugin seems to work pretty well (and past versions have not had this issue), so I'm pretty sure it's not an setup error with Facebook or anything else. While I'm running some more isolation tests I figured it would be prudent to post the logs here and get prime31's opinion of it. The abbreviated logcat output is below; everything above this is working as expected and looks fine in logcat.

    Code (csharp):
    1.  
    2. 04-30 12:38:22.487: I/Unity(17966): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    3. 04-30 12:38:22.487: I/Unity(17966): UnityEngine.Debug:Log(Object)
    4. 04-30 12:38:22.487: I/Unity(17966): GameFacebook:OnLeaderboardComplete(String, Object) (at D:\Users\Michael\Projects\Make or Break Games, LLC\Jetpack Game\Assets\Scripts\GameFacebook.cs:534)
    5. 04-30 12:38:22.487: I/Unity(17966): Prime31.P31RestKit:processResponse(WWW, Action`2)
    6. 04-30 12:38:22.487: I/Unity(17966): Prime31.<send>c__Iterator0:MoveNext()
    7. 04-30 12:38:22.487: I/Unity(17966):  
    8. 04-30 12:38:22.487: I/Unity(17966): (Filename: D Line: 0)
    9. 04-30 12:38:22.587: I/ActivityManager(604): Process com.MoBG.JetpackCat (pid 17966) has died.
    10. 04-30 12:38:22.587: W/InputDispatcher(604): channel '42f2dbb0 com.MoBG.JetpackCat/com.prime31.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
    11. 04-30 12:38:22.587: E/InputDispatcher(604): channel '42f2dbb0 com.MoBG.JetpackCat/com.prime31.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
    12. 04-30 12:38:22.587: W/ActivityManager(604): Force removing ActivityRecord{42caa828 u0 com.MoBG.JetpackCat/com.prime31.UnityPlayerNativeActivity t410}: app died, no saved state
    13. 04-30 12:38:22.597: W/InputDispatcher(604): Attempted to unregister already unregistered input channel '42f2dbb0 com.MoBG.JetpackCat/com.prime31.UnityPlayerNativeActivity (server)'
    14. 04-30 12:38:22.597: I/WindowState(604): WIN DEATH: Window{42f2dbb0 u0 com.MoBG.JetpackCat/com.prime31.UnityPlayerNativeActivity}
    15. 04-30 12:38:22.597: W/WindowManager(604): Force-removing child win Window{42f5e618 u0 SurfaceView} from container Window{42f2dbb0 u0 com.MoBG.JetpackCat/com.prime31.UnityPlayerNativeActivity}
    16. 04-30 12:38:22.617: W/WindowManager(604): Failed looking up window
    17. 04-30 12:38:22.617: W/WindowManager(604): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@42f50b68 does not exist
    18. 04-30 12:38:22.617: W/WindowManager(604):   at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7923)
    19. 04-30 12:38:22.617: W/WindowManager(604):   at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7914)
    20. 04-30 12:38:22.617: W/WindowManager(604):   at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1047)
    21. 04-30 12:38:22.617: W/WindowManager(604):   at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
    22. 04-30 12:38:22.617: W/WindowManager(604):   at dalvik.system.NativeStart.run(Native Method)
    23. 04-30 12:38:22.617: I/WindowState(604): WIN DEATH: null
    24. 04-30 12:38:22.677: W/InputMethodManagerService(604): Got RemoteException sending setActive(false) notification to pid 17966 uid 10152
    25. 04-30 12:38:22.687: W/Binder(26796): Caught a RuntimeException from the binder stub implementation.
    26. 04-30 12:38:22.687: W/Binder(26796): java.lang.NullPointerException
    27. 04-30 12:38:22.687: W/Binder(26796):    at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
    28. 04-30 12:38:22.687: W/Binder(26796):    at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
    29. 04-30 12:38:22.687: W/Binder(26796):    at android.os.Binder.execTransact(Binder.java:404)
    30. 04-30 12:38:22.687: W/Binder(26796):    at dalvik.system.NativeStart.run(Native Method)
    31. 04-30 12:38:22.817: D/Zygote(174): Process 17966 terminated by signal (11)
    32. 04-30 12:38:36.352: D/dalvikvm(9252): GC_CONCURRENT freed 403K, 6% free 9987K/10524K, paused 4ms+1ms, total 62ms
    33. 04-30 12:39:08.206: D/dalvikvm(9252): GC_CONCURRENT freed 400K, 6% free 9987K/10524K, paused 6ms+2ms, total 73ms
    34. 04-30 12:39:18.897: D/dalvikvm(729): GC_CONCURRENT freed 4938K, 50% free 23227K/45860K, paused 11ms+14ms, total 112ms
    35.  
    36.  

    EDIT: I forgot to mention that I just redownloaded the latest version of the plugin and the P31 tools to make sure that wasn't the issue, and it still crashes :-/
     
    Last edited: Apr 30, 2014
  39. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @vvander, there isn't enough information to say what is happening in that log. The app jettison appears to be because of "Got RemoteException sending setActive(false) notification" on the native side though that could be a symptom of the underlying issue and not a cause. From the looks of the log I am assuming GameFacebook:OnLeaderboardComplete doesn't do anything besides use Facebook.cs class methods. None of them are native code. They are all in Unity done via the WWW class. I would suggest testing your Facebook.cs class calls directly in the Unity editor (just set the accessToken field to any valid access token) to quickly rule out the potential causes.
     
  40. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72

    Thanks for your quick reply! That's disheartening but somewhat expected considering what the log says (or doesn't say I suppose). How would I get a valid access token? After logging in on my device and trying to print Facebook.instance.accessToken to logcat it comes up as an empty string.
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @vvander, try the getAccessToken method in the FacebookAndroid class.
     
  42. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    That worked to get the access token, thanks! After a few modifications, I was able to get everything set up to work in the editor. Unfortunately (for me) it seems to work perfectly when running in the editor, but it still crashes when built to my device. Any ideas on where to go from here? My only thought is to start cutting out large sections of code via Binary Search Debugging - which, frankly, sounds like a nightmare.

    It's quite frustrating as the game has been released and working (see my signature!), albeit with a few bugs, for some time now.


    EDIT: Ok now I'm thoroughly confused! It seems to be working on my device again! That's great news, but I'm a little concerned that it might happen again. I'm pretty sure all I did was add some #if !UNITY_EDITOR wrappers to make the native calls go away when testing with the editor. It's marginally terrifying when code does something magical, regardless of whether it's white or black magic haha
     
    Last edited: Apr 30, 2014
  43. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    hey im having the same problem as soulburner from page 111
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @vvander, that is certainly an odd one. Perhaps try a device reboot and keep a close eye on it to see if it pops up again.
     
  45. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    Will do, thanks for your guidance, prime!
     
  46. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    I tried implementing your Social and Admob combo packs into a project I have been working on and has build without problems.

    After importing your package, updating Prime31 tools from the menu, Generate AndroidManifest.xml file:
    I get this error:

    Code (csharp):
    1.  
    2. Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
    3. C:\android\sdk\build-tools\android-4.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/android/sdk/platforms/android-19\android.jar" -F bin/resources.ap_ --extra-packages com.facebook.android:com.google.android.gms -S "D:\Projects\SURVIVE\Temp\StagingArea\android-libraries\Facebook-Plugin-Library\res" -S "D:\Projects\SURVIVE\Temp\StagingArea\android-libraries\google-play-services_lib\res"
    4.  
    5. stderr[
    6. res\values\attrs.xml:20: error: Attribute "show_pictures" has already been defined
    7. res\values\attrs.xml:21: error: Attribute "extra_fields" has already been defined
    8. res\values\attrs.xml:22: error: Attribute "show_title_bar" has already been defined
    9. res\values\attrs.xml:23: error: Attribute "title_text" has already been defined
    10. res\values\attrs.xml:24: error: Attribute "done_button_text" has already been defined
    11. res\values\attrs.xml:25: error: Attribute "title_bar_background" has already been defined
    12. res\values\attrs.xml:26: error: Attribute "done_button_background" has already been defined
    13. res\values\attrs.xml:29: error: Attribute "multi_select" has already been defined
    14. res\values\attrs.xml:32: error: Attribute "radius_in_meters" has already been defined
    15. res\values\attrs.xml:33: error: Attribute "results_limit" has already been defined
    16. res\values\attrs.xml:34: error: Attribute "search_text" has already been defined
    17. res\values\attrs.xml:35: error: Attribute "show_search_box" has already been defined
    18. res\values\attrs.xml:38: error: Attribute "confirm_logout" has already been defined
    19. res\values\attrs.xml:39: error: Attribute "fetch_user_info" has already been defined
    20. res\values\attrs.xml:40: error: Attribute "login_text" has already been defined
    21. res\values\attrs.xml:41: error: Attribute "logout_text" has already been defined
    22. res\values\attrs.xml:44: error: Attribute "preset_size" has already been defined
    23. res\values\attrs.xml:50: error: Attribute "is_cropped" has already been defined
    24. ]
    25.  
     
  47. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    This was because I had another res folder from another plugin in the Android folder. What do you recommend for merging existing plugins? One thing I noticed is one of my plugins uses a different manifest which has a different package name in the Manifest line of the AndroidManifest. I haven't tried to merge it together.
     
  48. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @unitynewb, "UNEXPECTED TOP-LEVEL EXCEPTION" almost always occurs due to having duplicate jar files in your project. Delete all but one of the jar files and it will clear up the error.
     
  49. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    Yeah sorry I noticed the problem and removed the post, but looks like you saw it before I deleted it.

    Thanks
     
  50. valmin

    valmin

    Joined:
    Apr 30, 2014
    Posts:
    3
    How can I give you backtrace? I invoked in the Unity method TwitterBinding.showLoginDialog(), it invokes _twitterShowOauthLoginDialog (in iOS native code) and it invokes showOauthLoginDialog method from TwitterManager.h.
    Than I see such line in output: "2014-05-06 14:18:45.716 PocketPuppy[34749:907] got reqeust token" and project just stop. If I can give you more info somehow - just tell me how to do it.

    Thank you