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

OpenKit Unity3d plugin

Discussion in 'iOS and tvOS' started by iStrangler.com, Oct 30, 2013.

  1. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Hi,
    if you don't know anything about OpenKit, just bother google and you will see dozens of press articles, but no deeper informations. Maybe a reason is that OpenKit just started in september this year, so it's quite new.

    There is a Unity-plugin of OpenKit too. That's why I thought I should start a thread here, though the support, Suneet Shah (co-founder of OpenKit) in particular, is very fast, competent and friendly. I hope he will join us here in time.

    Get it here (for free): http://www.openkit.io
    Docs (WIP): http://openkit.io/documentation/

    Please tell me and forgive me if there is already a thread. Thank you! :)
    I hope the next update will be released soon. Looking forward to the ghosting feature (which fits perfectly for my game COLORMIXER).

    So let's go. Do you have any experience with this thing? Questions? Problems?

    best regards,
    Dennis
     
    Last edited: Oct 30, 2013
  2. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Since iOS7 the status bar will appear as soon as OpenKit is triggered.
    In case somebody has the same issue here is a workaround, which Suneet Shah told me:

    Hope that helps.
     
  3. OpenKit

    OpenKit

    Joined:
    Nov 3, 2013
    Posts:
    7
    Thanks for starting the thread! This is Suneet from OpenKit. I'd be happy to answer any questions here or tell you more about OpenKit.
     
  4. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Hi Suneet, nice to meet you here.
    Recently I started watching you on gitHub. It is very interesting seeing you making progress on this project.
    Seems like you focusing on the openkit server at the moment.
    Anyway, could you tell me when will the ghosting feature be available? (Please forgive me, if it is already available and I just missed it)
     
  5. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Sry for double posting again, but I hope I will get an answer this time.

    Suneet, is there a "share score on Twitter/Facebook" feature planed for openkit?
     
    Last edited: Nov 18, 2013
  6. Mamul

    Mamul

    Joined:
    Sep 21, 2013
    Posts:
    11
    I am also using OpenKit but there seem to be a problem with the connection to the OpenKit server.What might be the problem ?
     
  7. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    I would like to help you, but I need more information. What does your console say? Do you get any errors? Is your leaderboard setup in iTunes connect complete?
     
  8. Mamul

    Mamul

    Joined:
    Sep 21, 2013
    Posts:
    11
    When I run the game with the demoscene It shows me the loginGUI facebook and google.When i'm logged it shows me the GUI again and when i click login it sends me a message "Unable to connect to OpenKit server".Then it redirects me to the scene with the buttons.When i click on some buttons it sends me again this msg "Unable to connect" and when i click on logout it crashes.
     
  9. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    http://openkit.io/documentation/sample-apps

    Did you follow these steps?

     
  10. Mamul

    Mamul

    Joined:
    Sep 21, 2013
    Posts:
    11
    Yes I did everything according to the tutorial.I checked 3 time to see if i made some mistake with the ID's I'll check again to be sure.I runned it on actual device the same problem appears
     
  11. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Hopefully Suneet from openkit is coming up soon and help you. I can only tell you that there is no problem with the server, because it's running fine in my game.

    Maybe the quickest way to reach him is to write him an email. If you do so don't forget to post it here for the community :)

    team@openkit.io
     
  12. Mamul

    Mamul

    Joined:
    Sep 21, 2013
    Posts:
    11
    Yes i wrote him an e-mail i hope we find the problem and fix it.Thank for the help anyway at least i know that the problem is not the server itself and I hope to find my mistake soon and fix it.
     
  13. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Did you get any answer? I am following the openkit guys on GitHub and there was no change on the unity branch for the last two weeks. Actually there was no update on all branches for one week. :(

    I hope the best for this project and can't wait to get the next update :)
     
  14. Mamul

    Mamul

    Joined:
    Sep 21, 2013
    Posts:
    11
    iStranger I got only one answer from Suneed and that was 1 week ago since then I have no answer I wrote him another e-mail still no answer.I hope he received them and will answer soon.The thing thats really bugging me is that it is connecting to the facebook app I can see it in the facebook dashboard but why is telling me unable to connect to OpenKit.And even when it sends me the msg when i click on leaderboard and i click on invites I can see the list with my friends.But in the log it says Did not find OpenKit user.
     
  15. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Last try. Just wrote him an email. Hope he will reply. Otherwise I have to use another plugin :(
     
  16. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Hey Dennis,

    Yeah we are all on thanksgiving vacation right now so short reply.. I apologize for the lack of responses on the forum , I'll get to that tomorrow. Thanks for bringing that to my attention! Project is definitely alive! Were just working on a bunch of stuff that we have not pushed up to the repo yet but we have a new update coming soon.

    On Saturday, November 30, 2013, Dennis Wuerger wrote:
    Hey Suneet,
    It has been a long time since I saw any progress on OpenKit. I love your work so far and hope this project is still alive? We are already a little bit worried in the unity forum. Please tell me your whole team is just making a long holiday journey :)

    I hope to hear a life sign from you soon.
    Best regards,
    Dennis


    :)
     
  17. OpenKit

    OpenKit

    Joined:
    Nov 3, 2013
    Posts:
    7
    Sorry for the delayed response guys-- I've reached out to Dennis here via e-mail. Mamul, was there another question of yours that I missed?
     
  18. Mamul

    Mamul

    Joined:
    Sep 21, 2013
    Posts:
    11
    No you answered all my questions and helped me to integrate OpenKit .But there is something I want to ask you.Is there a way to get the name of the user not just a ID.For example you login and in the menu it says Hello "name of the user".All the ID are just numbers.If there is an option like this it would be great.
     
  19. OpenKit

    OpenKit

    Joined:
    Nov 3, 2013
    Posts:
    7
    You can use: OKUser.GetCurrentUser().UserNick
     
  20. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Hi Suneet,
    I'm testing the version 1.1 of OpenKit right now. Works fine till now.

    But I have one question:
    Since version 4 of Unity I guess it is possible to build Xcode projects on a Windows PC.
    But there is a problem if OpenKit is enabled: At the end of the building process Unity asks me how to open the postbuildscript. Is it even possible to run this postbuildscript on a windows7 machine?
    On OSX it works perfectly, so the issue is just kind of a comfort, time saving thing.

    Best regards,
    Dennis
     
  21. OpenKit

    OpenKit

    Joined:
    Nov 3, 2013
    Posts:
    7
    Hi Dennis,

    Unfortunately our iOS post build script won't work on Windows-- it's written for the OSX command line. So to build for iOS you will have to use OSX. You should be able to build for Android on Windows using OpenKit.

    Thanks,
    Suneet
     
  22. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    Alright, thank you Suneet! :)
     
  23. iStrangler.com

    iStrangler.com

    Joined:
    Oct 30, 2013
    Posts:
    25
    New Day, new question.
    Suneet, could you tell me something about the ghosting feature? I can't find it in the docs. Is it fully integrated in OpenKit already?
     
  24. Keepabee

    Keepabee

    Joined:
    Jul 12, 2012
    Posts:
    58
    Oh, boy. I've been attempting to integrate OpenKit 1.1 Unity plugin for two weeks now. Currently standing issues are as follows:

    --- Issue 1 of 2 ---
    Login via FB didn't work on my colleagues Android device while they had Facebook app / messenger installed and were logged into that. After uninstalling Facebook apps and the messenger from his phone, our app's OpenKit/FB succeeded in logging in.

    My colleague's device is Samsung galaxy s3 gt-I9300 running Android 4.3.

    --- Issue 2 of 2 ---
    We lookup the player's score on a leaderboard: leaderboard.GetUsersTopScore(playerBestScoreRequestHandler)
    After receiving a response (with response's OKScore being null in our case of a new player) we do some processing, where we try to see if OpenKit is logged in. Running our isLoggedIn() crashes after we call either OKManager.IsUserAuthenticated() or OKManager.GetCurrentUser(). Both methods run successfully, once, at the startup of our game, but calling them after receiving a score query response crashes the game inexplicably with following ADB logcat output:

    I/Unity (21096): *** TUOKIO UI LOG
    I/Unity (21096):
    I/Unity (21096): ... enabled. Checking if authenticated ...
    I/Unity (21096):
    I/Unity (21096): ***
    I/Unity (21096):
    I/Unity (21096): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
    I/Unity (21096):
    E/dalvikvm(21096): JNI ERROR (app bug): accessed stale local reference 0x1d200001 (index 0 in a table of size 0)
    E/dalvikvm(21096): VM aborting
    F/libc (21096): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 21244 (GC_start_routin)​

    isLoggedIn() method is called after receiving a "players best score" response from leaderboard. The last ADB logcat output is:

    "... enabled. Checking if authenticated ..."​

    or if I comment out the if ( OKManager.IsCurrentUserAuthenticated() == false ) block including the return statement, last output is:

    "... authenticated. Checking if current user is available ..."​

    TuokioUILog.LogLine basically does a Debug.Log() to output into adb logcat.

    Code (csharp):
    1. public static bool isLoggedIn()
    2. {
    3.     TuokioUILog.LogLine("Is logged in? Checking if plugin is enabled..");
    4.  
    5.     if ( OKManager.IsEnabled() == false )
    6.         return false;
    7.        
    8.     TuokioUILog.LogLine("... enabled. Checking if authenticated ...");
    9.  
    10.     // Call to IsCurrentUserAuthenticated() seems to crash at least in some circumstances (after player leaderboard score response).
    11.     if ( OKManager.IsCurrentUserAuthenticated() == false )
    12.         return false;
    13.        
    14.     TuokioUILog.LogLine("... authenticated. Checking if current user is available ...");
    15.    
    16.     // Call to GetCurrentUser seems to crash at least in some circumstances (after player leaderboard score response).
    17.     if ( OKManager.GetCurrentUser() == null )
    18.         return false;
    19.        
    20.     TuokioUILog.LogLine("... current user exists. Yes, is logged in!");
    21.  
    22.     return true;
    23. }
     
  25. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Hi Guys,

    I know you can use OKManager.IsCurrentUserAuthenticated() to find if a user is logged in or not but what I wanted to know was how do you determine what button they press when presented with the Openkit Login UI.

    I want to know when they press Facebook login or No Thanks.
     
  26. Keepabee

    Keepabee

    Joined:
    Jul 12, 2012
    Posts:
    58
    More info on my "issue 2 of 2" in my previous message:

    Seems that the crash comes from calling OKManager.GetCurrentUser() or OKManager.IsUserAuthenticated() and possibly some other OKManager methods within a callback, possibly due to some kind of internal looping.

    A 2-line repro would go like this:
    Code (csharp):
    1. OKLeaderboard leaderboard = new OKLeaderboard(123);
    2. leaderboard.GetUsersTopScore((OKScore _score, OKException _exception)=>{ Debug.Log(OKManager.IsCurrentUserAuthenticated()); });
     
  27. DannyB

    DannyB

    Joined:
    Jun 20, 2012
    Posts:
    214
    Hey,

    I am unsuccessful at building for iOS with OpenKit.
    Getting linker errors. Emailed the OpenKit team, but no response so far.

    Was wondering if anyone else experienced it?
     
  28. Keepabee

    Keepabee

    Joined:
    Jul 12, 2012
    Posts:
    58
    More bugs/issues!

    Issue 3 - requesting URGENT update (our in-dev project is currently dependent on this)

    $DynamicFontButNonUnicodeString.png

    OKUser.UserNick has bad unicode encoding when receiving List<OKScore> response from OKLeaderboard.GetFacebookFriendsScores(...), in OKScore.user.UserNick. OpenKit's own leaderboards view displays usernames with unicode characters correctly, but the data received in an async response had unicode characters replaced with codes like "\U00E4" or "\U00F6".

    We have a dynamic UI font displaying user names, but this entire feature relies on us receiving the correct Unicode-enabled string data. Please advise or mention some timeline if we could expect an update to fix this issue somewhere soon.

    Issue 4:

    $PostRotationDuplicates.png

    We don't intend to use OpenKit's default leaderboard view, so for us this isn't critical currently, but we did notice another bug there. When displaying the default leaderboards view and having some scores visible, rotating the device/UI duplicates the score entries per-user.
     
    Last edited: Mar 18, 2014
  29. DannyB

    DannyB

    Joined:
    Jun 20, 2012
    Posts:
    214
    Is OpenKit still alive? I am getting a vibe of a less maintained project, it would be a shame as currently this is my top option for social integration, but I cannot make it work...
     
  30. CStocker

    CStocker

    Joined:
    Jan 2, 2013
    Posts:
    3
    Hi,

    we've integrated OpenKit in our project and i know quite good how to handle certain issues.

    So, as for the crashes:

    Don't access stuff in an OpenKit callback! Set a flag and use the data in the next update.. this is only a problem on Android, but if you use a debug build you will get an error output.
    So, store the data somewhere and process it one frame after. Creating Objects, accessing Openkit stuff will crash your app!

    As for your unicode problem:

    It seems that the json from the server is a bit useless in this case, you need to convert the string. So, open OKUser.cs and modify it a bit:

    change
    Code (csharp):
    1.  
    2. this.UserNick = userJSON.GetField("nick").str;
    3.  
    to something like this:

    Code (csharp):
    1.  
    2. this.UserNick = ConvertJSONString(userJSON.GetField("nick").str);
    3.  
    4. public static string ConvertJSONString(string json_string)
    5. {
    6.   if(json_string == null || json_string.Length <= 0)
    7.     return "";
    8.      
    9.   json_string = System.Text.RegularExpressions.Regex.Replace(json_string, @"\\u([\dA-Fa-f]{4})", v => ((char)System.Convert.ToInt32(v.Groups[1].Value, 16)).ToString());
    10.   json_string = System.Text.RegularExpressions.Regex.Replace(json_string, @"\\x([\dA-Fa-f]{4})", v => ((char)System.Convert.ToInt32(v.Groups[1].Value, 16)).ToString());
    11.      
    12.   return json_string;
    13. }
    14.  
    Hope that helps
     
    AlexRay likes this.
  31. theWinnie

    theWinnie

    Joined:
    Sep 17, 2012
    Posts:
    2
    Hey guys,

    I'm trying to integrate OpenKit into our game and I'm almost done, but I've run into a few hiccups.

    1. Is there a way to retrieve an OKUser's profile picture as a Texture2D? Kind of like what you have, Meatgrind. Not sure if you're getting that from OpenKit or Facebook/etc
    2. Has anybody tried using OpenKit and Google Ads Mobile on Android? (https://github.com/googleads/googleads-mobile-plugins/tree/master/unity/android) It's not working for me, possibly because of a clash between google-play-services module in both OpenKit and Google Ads Mobile.
     
  32. Keepabee

    Keepabee

    Joined:
    Jul 12, 2012
    Posts:
    58
    CStocker, hi!

    Just letting you and everyone else know that your advice solved the Unicode issue we had with received OKUser.UserName fields. Thanks a bunch, that was awesome good news and progress for us!

    theWinnie: we force the users to login to OpenKit only via FB, by disabling GameCenter/Google Play login options, and then use the FB ID of OKUser to get the profile picture from FB SDK. Can't give hints regarding namespace clashes and the like, since those are problems we have been unable to solve - we dropped Prime31 SocialNetworking plugin at least for now, since it has FB SDK integrated and kept clashing with the official FB Unity SDK that OpenKit requires.
     
    Last edited: Mar 27, 2014
  33. OminStyle

    OminStyle

    Joined:
    Mar 18, 2013
    Posts:
    15
    Hi, I'm having trouble getting OKDemoScene to work. I get the GUI on my android but nothing happens when I click on the buttons. I was able to get the facebook sdk to work separately though. I'm using Unity 4.3.3f1 and followed http://openkit.io/documentation/#unity. The only error I get is "Your Android setup is not correct. See Settings in Facebook menu." but as I mentioned earlier, I facebook demo is working for me. Has anyone else experience this or have a solution?
     
  34. OpenKit

    OpenKit

    Joined:
    Nov 3, 2013
    Posts:
    7
    When you call OKUser.getCurrentUser() you can see if they have a Facebook ID or a Google ID which can approximate which button they pressed--- that's a good feature request though.
     
  35. OpenKit

    OpenKit

    Joined:
    Nov 3, 2013
    Posts:
    7

    Where is that error coming from? Is that in the Unity console? When you build and run on Android, what does logcat say? Shoot me an e-mail at team@openkit.io with more info..
     
  36. OpenKit

    OpenKit

    Joined:
    Nov 3, 2013
    Posts:
    7
    Were you able to get it working with the Google ads mobile project? If not shoot me an e-mail and I can help
     
  37. Imawizrd

    Imawizrd

    Joined:
    Jan 19, 2013
    Posts:
    20
    Hey,

    I have linker errors with my Xcode project as well. I'm currently trying to solve them.

    Solution:
    So I finally worked it out. I kept ignoring the errors in the Unity console that popped up when building.

    - Missing Facebook App ID
    - Missing AppKey missing SecretKey

    Because I remembered entering them in the OpenKit config window. (Window > OpenKit > Config). But you need to enter the details into the OpenKit config every time before you build. When you do that your Xcode project shouldn't have any errors related to OpenKit.


    I noticed a bug today as well. When you rotate your Android device from portrait to landscape it creates new listings of your Facebook friend's score under the friends section of a leader board. This results in duplicates. You can keep rotating it back and forward and create an infinite amount.
     
    Last edited: May 28, 2014