Search Unity

Anyone interested in accessing the entire iOS SDK API from Unity?

Discussion in 'iOS and tvOS' started by u3dxt, Jul 6, 2013.

  1. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I use C#. Thanks.
     
  2. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
  3. badescuga9

    badescuga9

    Joined:
    Dec 11, 2012
    Posts:
    37
    nice job on the sdk api!

    I saw that you now support *mp3 export*. What does that mean? is there access to converting .wav to .mp3? If so, are there some instructions available? i am interested in purchasing this fine asset!

    I am interested in converting in Unity3d some .wav files to .mp3 and using them inside unity3d
     
    Last edited: Jan 7, 2014
  4. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
  5. badescuga9

    badescuga9

    Joined:
    Dec 11, 2012
    Posts:
    37
    I record .wav files from the microphone so i don't have them at the time of the build.. so i need an mp3 converter that works in MONO .NET (which it seems does not exist).
     
  6. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    @u3dxt I seem to have having a problem with TurnBasedMatch.currentParticipant.player being null, even though TurnBasedMatch.currentParticipant.playerID is valid. TurnBasedMatch.participants (_participants internally) is also valid and all their player properties are also valid, only TurnBasedMatch.currentParticipant.player is null. TurnBasedMatch.ReloadPlayers() seems to load the player objects for _participants, so it doesn't set currentParticipant.player.

    Is this because it is using gkTurnBasedMatch.currentParticipant (see TurnBasedMatch.cs, line 126) and is this considered a bug?

    Thanks.
     
  7. lugrana88

    lugrana88

    Joined:
    May 23, 2011
    Posts:
    71
    hello!
    I bought your plug-in but does not work.

    I am interested in in-app purchase, and if I start the test scene, I can not see the buttons to make the test purchase.

    can you help me?

    thank you!
    $Screen Shot 2014-01-09 at 09.59.27.png
     
  8. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @danien This bug is fixed in version 1.6.3.1. The Unity Asset Store version is not approved yet. If you want to get it sooner, you can PM us with your invoice number, and we will send you directions to download it.

    @lugrana88 Are you running the scene within Unity editor? Native plugins only work on device.
     
  9. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    Hi, I'm already using 1.6.3.1 according to Assets->U3DXT->About. I'm also using the high level source code version of GameKit (not GameKit7) from Github.

    I'm running into another issue with TurnBasedMatch._GetNextActiveParticipants() at line 324 in https://github.com/vitapoly/u3dxt/blob/master/src/highlevel/gamekit/GameKit/TurnBasedMatch.cs:

    Code (csharp):
    1. var index = Array.IndexOf(_participants, currentParticipant);
    where index is -1 even though the currentParticipant's playerID is one of the playerID values in _participants. I suspect the actual instance of currentParticipant is not in the participants array. Do you think this is related?

    EDIT: More participants-related issues, especially between low-level and high-level instances not being the same instances or not syncing.

    When a match ends, I set the matchOutcome for every participant in TurnBasedMatchesController.currentMatch.participants and then call EndMatch. However, I get an exception from the low-level GameKit interfaces about the matchOutcomes being invalid for participants.

    If I use the low-level objects to set the match outcomes directly,
    Code (csharp):
    1.  
    2. for (int i = 0; i < match.gkTurnBasedMatch.participants.Length; ++i)
    3. {
    4.        U3DXT.iOS.Native.GameKit.GKTurnBasedParticipant participant =
    5.             (U3DXT.iOS.Native.GameKit.GKTurnBasedParticipant)(match.gkTurnBasedMatch.participants[i]);
    6.         participant.matchOutcome = U3DXT.iOS.Native.GameKit.GKTurnBasedMatchOutcome.Won;
    7. }
    8.  
    the match ends properly without any errors, which makes me suspect that setting the matchOutcome for the high-level participant objects doesn't actually set the low-level objects' matchOutcome.
     
    Last edited: Jan 12, 2014
  10. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @danien Yes, that is the cause. We also found out recently that the underlying implementation of the native iOS GKTurnBasedMatch.currentParticipant has changed. It doesn't return an object in the participants array anymore. So, we have fixed it by the high-level TurnBasedMatch.currentParticipant returning an object in the _participants array with the matching playerID. Sorry, we put the fix in GameKit7 high-level but forgot to copy it over to GameKit. If you are using the src right now, you can grab the currentParticipant code from https://github.com/vitapoly/u3dxt/blob/master/src/highlevel/gamekit7/GameKit/TurnBasedMatch.cs, and copy it over to the one for GameKit. We will also do that for the next version.
     
  11. agentleo

    agentleo

    Joined:
    Jan 2, 2011
    Posts:
    56
  12. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @agentloo Our plugin does not fully support UIKit. It's true that we have UILabel, Alerts, Uiwebview and even Picker. But it's never meant for creating a native GUI with Unity. Eventually, we will support it, but it's not a priority right now. In some cases, we will open up a few more native GUI elements like UIButtons, but it's just one offs to get our customers over the hump. Are you planning to create a native UI or just need a few GUI elements to be accessible? Thanks! Sorry about the delay in answers, we were debating the priority of UIKit internally.
     
  13. morten_nost

    morten_nost

    Joined:
    Nov 28, 2013
    Posts:
    6
    I see that in the "coming soon"-section for the SDK development you have Maps (MapKit).
    This is something I and my team are really interested to having full control over (just as you have natively in Xcode/Objective-C.

    Do you have an ETA on when this will be implemented? Or is it just soon™? :)
     
  14. robin_notts

    robin_notts

    Joined:
    Apr 7, 2010
    Posts:
    86
    $u3dxt problem.jpg

    You might be able to see the problem in the image above. I'm stuck inside the notification that lets you know about the changes in U3DXT. I can't see the OK button to click it and I can't press Escape key or anything, so without removing the plugin I'm stuck here unable to access my project. :/

    [EDIT: pressed Enter key and it updated. Not what I wanted to do, but it means I get to my project.]
     
    Last edited: Jan 13, 2014
  15. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @morten_nost There seems to be more demand for MapKit. We will give it higher priority and hopefully to have it within a month.

    @robin_notts We understand your frustration with this. We will address this dialog in the next version. However, we also encourage you to update to the latest version because of bug fixes and new features, as well as an option to turn off checking for updates.
     
  16. Mark-Sweeney

    Mark-Sweeney

    Joined:
    Feb 21, 2010
    Posts:
    172
    Which versions of iOS does the iCloud feature support? It works fine in iOS 7, but it crashes in iOS5 (which supports iCloud). I'm updating an app, and it has to support iOS5 and I'd rather not have an app with a feature that only works on some versions of iOS.

    This is the error report:

    U3DXTException: -[NSFileManager ubiquityIdentityToken]: unrecognized selector sent to instance 0x3127070
    at U3DXT.iOS.Native.Internals._CallbackCache._ThrowException (System.String str) [0x00000] in <filename unknown>:0
    at (wrapper native-to-managed) U3DXT.iOS.Native.Internals._CallbackCache:_ThrowException (intptr)
    at U3DXT.iOS.Native.Foundation.NSFileManager.UbiquityIdentityToken () [0x00000] in <filename unknown>:0
    at U3DXT.iOS.Data.iCloudPrefs._Init (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
    at U3DXT.iOS.Data.iCloudPrefs..cctor () [0x00000] in <filename unknown>:0
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for U3DXT.iOS.Data.iCloudPrefs
    at centersplash.Start () [0x00000] in <filename unknown>:0
     
  17. nachobeard

    nachobeard

    Joined:
    May 7, 2013
    Posts:
    47
    Hi

    I'm looking for a plugin which will allow me to access the touch events in iOS directly, because the touch functionality in unity (Input.GetTouch() often misses some touch events when the frame rate is low, for example).

    So I was hoping I'd be able to provide my own event handler in c# which will get called every time "touchesMoved" gets called from iOS.

    I've had a look through the documentation of your plugin but to be honest found it a little overwhelming, and can't work out if your plugin does this sort of thing or not.

    does it require unity pro?

    thanks.
     
  18. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Mark Sweeney The low-level API supports iOS 5 and up. However, in the high-level API (which we create to make it easier for developers), we used an iOS 6 API for iCloud. We will modify the high-level iCloud API to check for iOS 5 in the next version.

    @nachobeard We don't currently support getting touch events from iOS. That is in the plans along with the rest of UIKit, but we don't have an ETA yet. U3DXT does not require Unity Pro to work.
     
  19. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    I got a null exception in line 177 if the current participant is null because the match is over. Wrapped the relevant code with an if statement checking for null and submitted a pull request in github.

    Thanks again for the quick response!
     
  20. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    Apparently my application crashes when I use Application.LoadLevelAdditiv() on my iPhone. But the error only occurs when the application is downloaded from the app store and not when I just run it right form xCode my iPhone. I tried it out on a couple devices and all seem to have the same error.

    I would be very pleased if you contact me as soon as possible!
     
  21. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @danien Thanks for contributing. We have merged your changes.

    @Fred'sIphone We posted a few questions for you in UnityAnswers.
     
  22. mgepm

    mgepm

    Joined:
    Oct 11, 2013
    Posts:
    38
    Sorry guys I figured it out I used .localizedPrice

    ////////////

    Hi guys,

    I am trying to figure out how to use "Local Price" with Iap, right now I am using a $ symbol and I want to use price that I set up in itunes connect and I wonder if its doable with u3dxt.

    ps. I am a ROOKIE with unity and c#

    Thanks in advance
     
    Last edited: Jan 17, 2014
  23. StarHunter32

    StarHunter32

    Joined:
    Feb 10, 2013
    Posts:
    99
    Hello,

    I've implemented Game Center and the Leaderboards works well with U3DXT.
    However, when I test the game and enter Game Center on top of the window, alongside the App rating option there's a facebook page like option. It's currently unavailable. I'm aware that it will be available when the app goes live, but my question is:

    Where should I put the facebook page URL in the GameCenter script?

    Thanks.
     
  24. Fulke

    Fulke

    Joined:
    Nov 24, 2013
    Posts:
    12
    Hi guys,

    I'm having some issues sharing a screenshot to Facebook. I tried using the code from here but I couldn't seem to get it working, so I tried using the API. Below is pretty much exactly the code I tried using, minus some non-related stuff. I just trigger the coroutine from a raycast hit.

    Code (csharp):
    1.  
    2. Facebook facebook;
    3. private bool _captured = false;
    4.  
    5. void Start ()
    6.         {
    7.         facebook.Init(appID, new string[] {"read_stream", "email", "publish_stream"});
    8. }
    9.  
    10. void Update ()
    11.         {
    12.  
    13.         if ( _captured  System.IO.File.Exists(Application.persistentDataPath + "/" + filename) )
    14.         {
    15.             Debug.Log("screenshot exists: " + Application.persistentDataPath + "/" + filename);
    16.             filename = Application.persistentDataPath + "/" + filename;
    17.  
    18.             facebook.PostPicture(facebookMessage, filename, null, null, null, null);
    19.            
    20.             //System.IO.File.Delete(Application.persistentDataPath + "/" + filename);
    21.             _captured = false;
    22.         }  
    23. }
    24.  
    25. IEnumerator takeScreenshot ()
    26.         {
    27.                 //Disable stuff I don't want in the screenshot
    28.                 screenshotCount = string.Format ("{0:000000}", screenshotCount);
    29.                 filename = screenshotCount + ".png";
    30.  
    31.                 yield return new WaitForEndOfFrame ();
    32.  
    33.                 Application.CaptureScreenshot(filename);
    34.                 _captured = true;      
    35.                 Debug.Log ("TAKE SCREENSHOT: " + Application.persistentDataPath);
    36.  
    37.                 yield return new WaitForSeconds (0.1f);
    38.                 iTween.CameraFadeFrom (1f, 0.1f);
    39.                 yield return new WaitForSeconds (0.1f);
    40.  
    41.                 screenshotCount++;
    42.                 //Enable
    43.         }
    44.  
    45.  
    46.  
    47.  
     
  25. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Danail Please see answer to your question here: http://answers.unity3d.com/questions/621363/facebook-page-like-in-gamecenter-with-u3dxt.html.

    @Fulke There are two ways to post to Facebook. The first way is to use SocialXT.Post() as in the link you posted. This is the preferred way because it prompts the user with a native dialog before posting. It is also easier to setup. As long as the user is logged in to Facebook on their device in the Settings app, then it works. If the user is not logged in, and you want to prompt them to setup Facebook, you can pass in false for the last argument.

    The second way is to use the Facebook class directly, which does NOT prompt the user and posts to their account directly. It also requires more to setup. You need to create a Facebook app in Facebook Developers page, with same bundle ID as your game, and you need to copy that Facebook app ID to pass into Facebook.Init(). At the time of init, it also prompts user to grant the permissions. If you really need to use this class, you can subscribe to InitializationFailed event, or specify a callback in the PostPicture() to see what the error is.
     
  26. serfer

    serfer

    Joined:
    Sep 6, 2012
    Posts:
    2
    I have a problem in PersonalTest scene in U3dXT plugin.

    I want to add some event to a specified date. But event adds a day before specified date.

    I modified inside addEventForTomorrow() method in Unity in PersonalTest.cs.

    before:
    PersonalXT.CreateSimpleEvent(eventTitle, DateTime.Today, DateTime.Today.AddHours(2));

    after:
    PersonalXT.CreateSimpleEvent(eventTitle, System.Convert.ToDateTime("2014-01-28"), System.Convert.ToDateTime("2014-01-28").AddHours(2));

    Problem is that, event adds to calendar a day before, to 27 of january not to a 28 of january.
    Even if I put DateTime.Today event adds to yesterday date.

    Can anybody help me to solve this issue? Thank you!
     
  27. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @serfer A quick look, it seems like a time zone issue. Can you please put the following code in your project to see if it works?:
    string eventTitle = "Buy U3dxt";
    NSTimeZone systemTimeZone = NSTimeZone.SystemTimeZone();
    NSTimeZone.SetDefaultTimeZone(systemTimeZone);
    PersonalXT.CreateSimpleEvent(eventTitle, DateTime.Parse("2014-01-24"),DateTime.Parse("2014-01-24").AddHours(2));


    If it still does not show the correct time, please let us know what your time zone is so we can investigate further.
     
  28. serfer

    serfer

    Joined:
    Sep 6, 2012
    Posts:
    2
    No it doesn't help me. In my iPad Date&Time settings are correct. My timezone is GMT+6.
    I also tried manualy set timezone:
    NSTimeZone systemTimeZone = NSTimeZone.TimeZone(3600*6);
    NSTimeZone.SetDefaultTimeZone(systemTimeZone);
    PersonalXT.CreateSimpleEvent(eventTitle, DateTime.Parse("2014-01-24"),DateTime.Parse("2014-01-24").AddHours(2));


    Method NSTimeZone systemTimeZone = NSTimeZone.LocalTimeZone(); doesn't work, it crashes.

    Only helps if I add DateTime.Parse("2014-01-24").AddHours(6)
     
  29. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi U3DXT,

    Did you guys ever get response from Unity3D or fixed the bugs regarding NGUI and this plugin? I'm talking about the ambiguous reference exceptions popping up when importing this asset in a project with NGUI also in the project.
     
  30. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @serfer We have released version 1.6.4.1, which fixes the date time problem. Using your original code should give expected date time. Unity Asset Store is reviewing our changes. If you would like it sooner, you can PM us with your invoice number.

    @Tripwire Unity confirmed the ambiguous reference bug in Javascript, and they said they would work on it but couldn't give us an ETA.
     
  31. cmdeviant

    cmdeviant

    Joined:
    Jul 24, 2012
    Posts:
    6
    Hey @u3dxt, I think I found a bug (or feature?):

    It seems that u3dxt plugin affects Android builds by adding android.prermission.camera to AndroidManifest.xml even on empty projects without any actual Camera native calls.

    Possible reason of this already described here.

    I noticed some WebCameraTexture references in plugin's xml files.

    In fact after deleting plugin's folder problem is gone. This is was my temporary workaround.
     
  32. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @cmdeviant, Thanks for letting us know about this. We are currently using WebCamTexture in our plugin. We will consider separating this out in future versions. But in the meantime, you will have to use your workaround or as suggested by the forum you referenced. Thanks again.
     
  33. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Hi, just wanted to report something about the Update window that comes up if there is a new version of U3DXT. If there are too many updates the buttons to close the update window are hidden if the window is taller than the vertical screen resolution. Might be a good idea to add a scrollbar to the update window :)
     
  34. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @capitalJmedia, Thanks for letting us know. We have fixed this by shortening the change log with "..." Scrollbars in a modal editor window was surprisingly difficult to do especially considering backwards compatibility with Unity 3.5. Of course, you will have to get the latest U3DXT version to see this change.
     
  35. Daniel-Costa

    Daniel-Costa

    Joined:
    Jun 6, 2013
    Posts:
    1
    I've seen in the first pages that you already worked on a tech demo using voice recognition.

    I'd like to know if you plan on releasing that feature for U3DXT or
    if you can share whatever you used for voice recognition in iOS.

    Any reference will be appreciated!

    My team is researching about Sphinx but we didn't achieve much yet.
     
  36. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    Can this asset be used when building to an xCode project on windows and then move the xCode project files over to mac to start the build in xCode? Since building to xCode projects from windows has been made able by unity?

    *Edit: Is there a documentation for JS?

    If the match requires 4 players and the local player invited two players how should I fill the last spot?
    Oh I see now that the player must first invite the desired players and then you can pass the invited players in to the StartMatch method:
    Code (csharp):
    1. RealTimeMatchesController.StartMatch(2, 4, 0, 0, e.playersToInvite);
    But then I have not been able to find "Show game center invite page" method, the only one I can find is "ShowGameCenter".
     
    Last edited: Feb 4, 2014
  37. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Daniel Costa, thanks for your interest in our speech recognition work. We have two ways of doing it. One is using the unpublished Google server APIs (record speech and send file to Google). There is some delay but accuracy is not bad. We cannot release this because it is using unpublished APIs.

    The second way is using OpenEars library, which requires you to first specify the words to recognize or the free mode which is not very accurate. We had not looked into their license. If permitted, we may consider releasing this one.

    @Darkoo, the current version of U3DXT can build on Windows. However, the post processing script does not work completely, and would require some manual edits (adding some libraries and frameworks, and editing one line) in Xcode before building. We will look into making the script work on Windows.

    There is no documentation for JS. However, our API (http://u3dxt.com/docs/api) works for C# and Javascript, with only minor syntax differences.

    For multiplayer, the other players will be filled by Game Center matchmaking. They are the people waiting to find players to play with.
     
  38. Deleted User

    Deleted User

    Guest

    Does U3DxT support UIPageControl?
     
  39. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @wcs-dev, we don't support UIPageControl in the current version. But we are adding it to our roadmap.
     
  40. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    Any chance you guys might be working on the Core Bluetooth framework? I'm prototyping some iBeacon AR apps right now and would love to be able to show the client how the app could work. Thanks.
     
  41. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    54
    Any way to free up the memory after using the SocialXT.Share function ?
    Everytime i use it it ads 8mb to the memory used.

    Cheers,
    Steve
     
  42. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    I can find "RealTimeMatchesController.currentMatch.SendData();" , but what about calling a method with arguments on other players?
     
  43. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @contempt, We are currently not working on the Core Bluetooth framework yet. But we are also interested in iBeacon and may put it higher on the todo list.

    @ninjanosui We will look into this.

    @Darkoo, The high-level API for multiplayer does not currently support RPC. But this sounds like a very useful thing, and we will add it soon. In the meantime, it would not be difficult to implement it now. On the calling side, you can send the call over and encode it in JSON. On the called side, in the DataReceived event callback, you can decode the JSON into the method name and arguments and then call it directly from there.
     
  44. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @ninjanosui, Are you passing big Texture2D's into the Share() method? If so, are you destroying the Texture2D afterward? Unity/Mono takes care of managing memory, but Texture2D needs to be explicitly destroyed by calling Texture2D.Destroy(image).
     
  45. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    54
    @u3dxt i'm using your method from the tutorial, its just a screenshot of iOS devices so 1024x768 etc :

    UIImage tmp = new UIImage(foto);


    SocialXT.Share(new object[]
    {
    titel,
    subject,
    tmp.ToTexture2D()
    }

    );
    System.IO.File.Delete(foto);
     
  46. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @ninjanosui The Share() method can actually take in UIImage as well as Texture2D. So you don't need to convert it first. BTW, the ToTexture2D() method creates a new Texture2D and when you are done with it, you need to destroy it. The leak is probably from this. Hope this resolves your issue.
     
  47. zemorango

    zemorango

    Joined:
    Feb 9, 2014
    Posts:
    1
    Hi u3dxt Team,
    first of all thanks for the great job your doing with this ios plugins.
    I'm using unity to make enterprise apps, not gaming, what i need is to be able to acess the device camera and the native maps, on ios, android and wp8, does your plugins support these native features, I really need them... if so then you have a new costumer here :D
     
  48. flyingaudio

    flyingaudio

    Joined:
    Dec 3, 2010
    Posts:
    98
    About 3 weeks ago, you thought you might have MapKit done in a month. How is it going? I need to start implementing a solution tomorrow. Do you need a beta tester for it? We are only in alpha, so it doesn't have to be perfect yet.
     
  49. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    How can one re-authenticate the local player once the local player has canceled the previous authentication attempt when the game center login screen shows. I have implemented a gui popup on authentication failed, there you can click retry and the button invokes:
    Code (csharp):
    1. GameKitXT.AuthenticateLocalPlayer();
    That douse nothing and also it seems the app is entirely locked out of authentication since when I close down the app and restart it, no authentication/gamcenter login slide shows. In xCode I can find this : "Local player authentication failed: The requested operation has been cancelled or disabled by the user."

    this might be related to game center sandbox accounts, they are really unpredictable in my experience.

    *Edit "fixed": it seems that when this happens the fix is to reset all settings on the device. "Settings>general>reset> reset all settings". But unfortunately this fix is not always working!!


    I had another question:
    Code (csharp):
    1. public function FindRandomPlayers(){   
    2.     Debug.Log("start looking for random match");
    3.     MMCoherentCalls.SetGuiSendLoadingMessage('searchingForRandomPlayers');
    4.     if (CoreXT.IsDevice) {
    5.         var request = new GKMatchRequest();
    6.         request.minPlayers = setNumberOfPlayers; //change back to setNumberOfPlayers
    7.         request.maxPlayers = setNumberOfPlayers;
    8.  
    9.         GKMatchmaker.SharedMatchmaker().FindMatch(request, OnCustomFoundMatch);
    10.     }
    11. }
    12. public function OnCustomFoundMatch(match:GKMatch, error:NSError) {
    13.    
    14.     if (error != null) {
    15.         Debug.Log("Error with matchmaker: " + error.LocalizedDescription());
    16.         MMCoherentCalls.SetGuiSendLoadingMessage('couldNotFindPlayers');
    17.     } else if (match != null) {
    18.         // set the high-level match, and it will raise MatchMakerFoundMatch event
    19.         RealTimeMatchesController.SetCurrentMatch(match);
    20.         Debug.Log("Random match found");
    21.     }
    22. }
    23.  
    When assigning the custom match to "SetCurrentMatch" the "MatchMakerFoundMatch" event will fire, but am I correct in thinking that the match is empty(no players)? and I need to use FindPlayers() and then assign them to the match.
     
    Last edited: Feb 10, 2014
  50. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @zemorango We currently only support iOS, but are planning to span to Android soon. WP8 is sometime down the road.

    @flyingaudio We are working on MapKit, and should expect to release in a few weeks.

    @Darkoo The Apple docs (sorry, can't find link now) says you are only supposed to call authenticate, which is what our GameKitXT.AuthenticateLocalPlayer() does, once when it starts the app, and it takes care of showing it when resuming the app also. If user cancels login 3 times, it will not prompt the user again. And you found the workaround to reset it. So, you should not call it again to forcibly show login again.