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. flyingaudio

    flyingaudio

    Joined:
    Dec 3, 2010
    Posts:
    98
    If I was to purchase it now, would I be able to get access immediately to a build that has MapKit in it? And would it be usable enough for some basic displays of maps with pinch-zoom and pan controls, and a couple of markers?
     
  2. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Darkoo You will get back a match with players already filled, just like when you are using the native user interface. Please also take a look at the Apple docs here for implementing a custom matchmaking interface: https://developer.apple.com/library...g.html#//apple_ref/doc/uid/TP40008304-CH9-SW6.

    @flyingaudio We don't have it in the current version yet. We are still working on it and will release it in the next few weeks.
     
  3. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    I'm having a trouble figuring out how to have a match created with "random" players similar to what happens when the user taps the "play now" bubble in the game centers invite slide. I would appreciate it if someone could clear things up for me as to how to do this.

    Thx u3dxt, then there is something that I am not doing correctly since I am running this:
    Code (csharp):
    1. var currentMatchPlayers = RealTimeMatchesController.currentMatch.players;
    2. for (var player in currentMatchPlayers) {
    3.         Debug.Log(player.playerID + ": " + player.alias);
    4.        
    5.         if(System.String.Compare(player.playerID, m_localPlayerID) > 0 )
    6.             canIhostServer = false;
    7.     }
    and it douse not output any player even thou "OnMatchMakerFoundMatch" event is getting fired.

    I will keep looking at apple docs and see what I have missed then, thanks again!
     
    Last edited: Feb 10, 2014
  4. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    I have gone back and forth between the documentations, I am unsertain of what is wrong, a match is found but it's not containing any player/players. Below is the most recent I have tried with.

    Code (csharp):
    1.  
    2. // Find random players and create match session
    3. public function FindRandomPlayers(){   
    4.     Debug.Log("start looking for random match");
    5.     MMCoherentCalls.SetGuiSendLoadingMessage('searchingForRandomPlayers');
    6.    
    7.     if (CoreXT.IsDevice) {
    8.         var request = new GKMatchRequest();
    9.         request.minPlayers = setNumberOfPlayers; //change back to setNumberOfPlayers
    10.         request.maxPlayers = setNumberOfPlayers;
    11.         request.playersToInvite = null;
    12.        
    13.         GKMatchmaker.SharedMatchmaker().FindMatch(request, m_OnCustomFoundMatch);
    14.     }
    15. }
    16.  
    17. public function m_OnCustomFoundMatch(match:GKMatch, error:NSError) {
    18.     if (error != null) {
    19.         Debug.Log("Error with matchmaker: " + error.LocalizedDescription());
    20.         //MMCoherentCalls.SetGuiSendLoadingMessage('couldNotFindPlayers');
    21.     } else if (match != null){
    22.         retainMatch = match;
    23.        
    24.         if(!randomMatchStarted  match.expectedPlayerCount == 0){
    25.             randomMatchStarted = true;
    26.             RealTimeMatchesController.SetCurrentMatch(match);
    27.         }
    28.     }
    29. }
    30.  
    and here is the "MatchMakerFoundMatch" event code that gets fired:
    Code (csharp):
    1.  
    2. function OnMatchMakerFoundMatch(sender:Object, e:MatchEventArgs){
    3.     // tell player "Game Center found a match" create a server with unity network
    4.     // and then remove remove loading message (on server init, on)
    5.     Debug.Log("invitation event: Match found!");
    6.    
    7.     if (e.realTimeMatch.expectedPlayerCount == 0 || randomMatchStarted)
    8.         On_dgFoundMatchProceed();  
    9. }
    10.  
     
  5. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Hey guys,

    I'm trying to add Game Center support to a game already in the app store. I've created a new version of the game in iTunes connect added leaderboards via the Manage Game Center button. I've then enabled Game Center added all the leaderboards to the new versions details page.

    The problem is I can't authenticate the user. It's always coming back AuthenticationFailed.

    Is there any steps I've missed?

    Thanks
     
  6. laserlars

    laserlars

    Joined:
    Nov 17, 2011
    Posts:
    255
    Enabled Game Center in xcode aswell ?
     
  7. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    Like laserlars said you need to make sure that in xCode game center is toggled to ON, this can be found under capabilities tab when your project is selected.
     
  8. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Yes, Game Center is toggled on in Xcode.

    Edit: Odd, I've just ran the build on my iPhone 5 and it's working. I'll have to look in to why it's not working on my iPad Air.
     
    Last edited: Feb 12, 2014
  9. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    Have you every pressed cancel on the ipad game center login slide? if you have more than 3 times it will no longer try to authenticate the user in that app. I had a repeating authentication failed problem too, and the only way I got rid of it was to log out of game center on the device, restarted the device and under "Settings>general>reset> reset all settings" then wait for the device to do it's thing.
     
  10. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Not that I can remember but it's possible I suppose. Thanks for the reply I'll try that.
     
  11. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    @u3dxt, I'm not 100% sure but I think that I am handling "e.realTimeMatch" which is retreived from the "MatchMakerFoundMatch(sender:Object, e:MatchEventArgs)" in a curtain way that when the event gets fired by "RealTimeMatchesController.SetCurrentMatch(match)" instead of "startmatch()" which is what it was intended for I am facing the unexpected results. and that is probably because the structure of the match that gets assaigned to current match is not the same as startmatch.

    Might it be so that when using SetCurrentMatch(match) the match properties will reside within e.realTimeMatch.gkMatch.
     
    Last edited: Feb 12, 2014
  12. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Darkoo, have you tried the GKMeeting example in Assets/U3DXT/gamekit7/GKMeeting? There is a button for programmatically matchmaking "Create /Join Custom UI". The code looks similar to your code, with the difference that we don't check for expectedPlayerCount. We just start the match but let the match's PlayerStateChanged event callback in Meeting.cs take care of adding new players as they join.
     
  13. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    A beta version is out with MapKit low-level API working. Example usages are also included. If you have not joined our beta program, check out our site. http://www.u3dxt.com
     
  14. flyingaudio

    flyingaudio

    Joined:
    Dec 3, 2010
    Posts:
    98
    Thank you for MapKit. I was very impressed with you supplying such a useful example, and not leaving us hanging with these new features, and all this in the beta version. Quality work.

    Looking forward to your high-level API, especially when you start shipping the Android version, so we can have an a abstraction layer to work with.

    We have it functioning in our app, but how do I get rid of the beta pop-up and text in the upper left corner? I purchased the pro version, but haven't installed it, because I went right to the beta for MapKit. I need to remove this message before the client sees an early build.

    I am starting to read through Apple's SDK on MapKit, but do you know how I can request through MapKit to use their (Apple's) database to populate pin information?

    Edit: How can I bring up a list of routing apps (like Maps), in case they want turn-by-turn?
     
    Last edited: Feb 14, 2014
  15. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @flyingaudio The Maps module is in beta version only and not in the full version yet. We don't want our beta testers to release with them. That's why we put the watermark there.

    To search for businesses or places of interest, you would want to use the MKLocalSearch class: https://developer.apple.com/library...erence/MKLocalSearch/Reference/Reference.html. We don't have API docs for the beta version yet, but the calls should be similar, except for the obvious syntax difference.

    From what it says in these two stackoverflow posts, it doesn't look like getting a list of routing apps is possible without much work: http://stackoverflow.com/questions/15661546/how-to-get-a-list-of-all-installed-routing-apps, http://stackoverflow.com/questions/14241569/how-to-let-the-user-choose-routing-app-in-ios-6.
     
  16. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    Very exciting package! Eager to get it working.

    Have a few issues I need help with.

    I'm using Unity 3.5.7f6 (non Pro) and Xcode 4.6.3.

    When I import package I do not see any menu items for U3DXF. I restart Unity.

    I still see no menu item for U3DXF. I move Editor folder to be stand alone folder in project. I also move plugin content to existing Plugin folder.

    When I restart I still see no menu item for U3DXF (except Assets->U3DXT but its only for selecting components and links to documentation, support, etc) and my menu item for HEDGEHOG Team's EasyTouch is gone!

    I use EasyTouch extensively so it being overwritten is troubling.

    Luckily I am able to recover by deleting all U3DXT content but I'd really like to get it working.

    Any help would be appreciated!
     
  17. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    What is your timeframe for updating Core Location framework to iOS 7.0's latest with support for CLBeacon?

    I've been really impressed with how easy it has been to integrate U3DXT's low level APIs into my AR project and many thanks for helping me set up the ReverseGeoCodeLocation method.

    Thanks again.
     
  18. bbigger

    bbigger

    Joined:
    Dec 28, 2011
    Posts:
    6
    I'm interested in this feature as well- it's the last item I need to build a game... ;)

    Thanks in advance!
     
  19. valkia

    valkia

    Joined:
    Jul 19, 2012
    Posts:
    7
    Hi u3dxt,

    I found that "Write a Review" button is disabled when i use SKStoreProductViewController in ios 7 and some people said Apple did that to make writing a review not that easy, is there a workaround for this issue? Thank you.
     
  20. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @jococo If you have a new project, does importing U3DXT work? After importing, you should see the menu item Assets->U3DXT with 11 sub items. You can select "Add Kitchen Sink Scenes to Build Settings" and then build to iOS and you can try the different examples. We will also try EasyTouch to see if there are any conflicts.

    @contempt @bbigger, We will try to have beta for CLBeacon in the next 2 to 3 weeks.

    @valkia This is a new iOS 7 restriction. We have no control over it and there is no workaround. The only thing you can do if you want them to review is to open your app's page in App Store app with your itms:// link.
     
  21. bbigger

    bbigger

    Joined:
    Dec 28, 2011
    Posts:
    6
    Super sweet. I'll be pulling the trigger this week once I finish my deadline. Thanks!
     
  22. a_tarerra

    a_tarerra

    Joined:
    Nov 7, 2012
    Posts:
    16
    Great work on the MapKit beta integration, seems to work well. I can't find the mapView:viewForAnnotation delegate, though, is this something that will get added later?
     
  23. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @a_tarerra The MKMapViewDelegate's mapView:viewForAnnotation method is shortened to just View(). We try to shorten names where possible.
     
  24. a_tarerra

    a_tarerra

    Joined:
    Nov 7, 2012
    Posts:
    16
    OK, thanks! Not completely clear on how that lets me create a new view for an annotation, which is what the "viewForAnnotation" delegate seems to be there for, though...?
     
  25. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi U3DXT

    It seems that the Ambiguous reference exceptions are fixed if using your plugin with NGUI?

    Since it's working again i'm going to work with it again :) I have a few questions:

    1. How easy is it to show a native popup with custom text and buttons? Are there any examples?
    2. Can I do local push notifications if so can you show me an example?
     
  26. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @a_tarerra In the delegate, you need to create a new MKAnnotationView or MKPinAnnotationView. For example:

    Code (csharp):
    1.  
    2. mapView = new MKMapView(new Rect(25, 100, Screen.width/2 - 50, Screen.height/2 - 150));
    3.  
    4. // create custom annotation view
    5. mapView.viewHandler = delegate(MKMapView view, MKAnnotation annotation) {
    6.     // try to reuse old view
    7.     var annotationView = mapView.DequeueReusableAnnotationView("annoview");
    8.     if (annotationView == null) {
    9.         Debug.Log("creating new annotation view");
    10.         annotationView = new MKAnnotationView(annotation, "annoview");
    11.         annotationView.canShowCallout = true;
    12.  
    13.         var image = new UIImage(new NSData(new NSURL("http://u3dxt.com/wp-content/uploads/2013/06/gears_14662320_s-225x225.jpg")));
    14.         annotationView.image = image;
    15.     } else {
    16.         Debug.Log("reusing old annotation view");
    17.         annotationView.annotation = annotation;
    18.     }
    19.    
    20.     return annotationView;
    21. };
    22.  
     
  27. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Tripwire We are not sure if Unity has fixed the problem with ambiguous reference. We are using 4.3.3f1, and it still has the problem if using same class name (UILabel) in Javascript. Are you using 4.3.4, and it works?

    We have a Kitchen Sink of examples!!! After importing U3DXT, you can go to the menu item Assets->U3DXT->Add Kitchen Sink Scenes to Build Settings, and run it on device. The popup example code you are interested in is in Assets/U3DXT/Examples/core/GUIBasics/.

    Unity has push notification built-in. See http://docs.unity3d.com/Documentation/ScriptReference/NotificationServices.html.
     
  28. a_tarerra

    a_tarerra

    Joined:
    Nov 7, 2012
    Posts:
    16
    @u3dxt Ah, thanks for clarifying that, much appreciated! I'm completely new to the iOS sdks, guess that shows:)
     
  29. Tripwire

    Tripwire

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

    I'm still using Unity 4.3.3f1 but with NGUI 3.5.0b. NGUI got a rather large update so maybe it's changed. It seemed to be working. I imported the latest version of U3DXT in my project with NGUI 3.5.0b and i didn't get any exceptions.

    I'll check the Kitchen sink thin and the push notifications :) thx!
     
  30. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    Hi,

    Got the below message from apple regarding push notification API:

    My app douse not use push notification. Keep in mind this might not have anything to do with u3dxt asset but still I posted just in case.
     
    Last edited: Feb 25, 2014
  31. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Darkoo You may safely ignore that message from Apple. We've included the push notifications API into our plugin. Since it's part of the Foundation framework, it's part of the U3DXT plugin core, so it's not possible to strip those bindings at this time. That message is just an automated message from Apple scanning our static libraries and making sure that the proper provisions are available for your app, otherwise push won't work in the production environment. So, if you are not using those APIs, it's safe to ignore. Thanks!
     
  32. jhample

    jhample

    Joined:
    Jul 7, 2012
    Posts:
    47
    It may have been addressed in here already (haven't looked at all 500+ posts), so forgive me if it has.

    I am having some issues with integrating Facebook. I am using another plugin to handle Facebook features on Android. The plugin uses "Facebook" as a namespace and U3DXT uses "Facebook" as a type. Is there a simple solution to getting around this problem? Or will I just need 2 separate projects and remove U3DXT from the Android project?
     
  33. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @jhample You can use the fully qualified name when using our Facebook class. You would need to change it in our examples also.
    Code (csharp):
    1.  
    2. _facebook = new U3DXT.iOS.Social.Facebook();
    3.  
     
  34. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    > @contempt @bbigger, We will try to have beta for CLBeacon in the next 2 to 3 weeks.

    Just checking in to see if your estimated timeframe for CLBeacon support is still on target for sometime this month. Thanks.
     
  35. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @contempt Sorry about that. We should have it out in beta sometime this month.
     
  36. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    No apologies necessary, just keep doing the great job you guys are doing. There's no rushing excellent work :D
     
  37. boriel

    boriel

    Joined:
    Jul 2, 2012
    Posts:
    19
    Don't know if this is technically possible on iOS (I've search through this thread and haven't found anything related to "launch" or "start"). Is it possible to launch another app from within Unity3D with this plugin (I know this is possible on an "Android Native" plugin)? :confused:
     
  38. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @boriel In iOS, you open another app by letting the system open an URL that the other app is registered to. In Unity, you don't need any plugin to do this. Just call Application.OpenURL(), https://docs.unity3d.com/Documentation/ScriptReference/Application.OpenURL.html. For example, passing in "http://www.u3dxt.com" to this method opens our website in Safari because Safari is the default app for handling http. So to use this, you need to find out what URLs the other app is registered to.
     
  39. boriel

    boriel

    Joined:
    Jul 2, 2012
    Posts:
    19
    Thanks for your reponse! ;)
    Unfortunately, I read about this yesterday, but I'm not sure this is what I'm looking for. I would like to make a game to load another game, they don't use any registered url scheme. I know http:// opens safari, fb:// facebook, and twitter:/// twitter. But I need to open 3rd party apps :|
     
  40. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @boriel Using URL schemes is the only way to launch other apps in iOS. 3rd part apps can also register for specific/custom URLs. If the other game you are launching is also yours or someone you are working with, the second game needs to define the custom URLs. If it is another game not under your control, you need to find out from the developer to see if they support any custom URLs.

    See Apple docs for more info: https://developer.apple.com/library....html#//apple_ref/doc/uid/TP40007072-CH7-SW18

    Hope this helps.
     
  41. boriel

    boriel

    Joined:
    Jul 2, 2012
    Posts:
    19
    Hmmm. Interesting.
    I wonder: is there a way to parametrize the URL, so something like <myprotocol>://<appname>/parameters launches the app (will read the docs, thanks). I would like to create a "launcher", and using an URL scheme for them... I mean, I could create something like: "urlscheme0://", "urlscheme99999://" but is a really ugly hack :(
     
  42. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @boriel Yes, you can parametrize the URL with regular URL params such as ulrscheme0://something/?param1=value1&param2=value2.
     
  43. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    Hi, there's no documentation yet for iCloud. How far along is this? Is there any sample code for implementing it?
     
  44. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Pix10, Sorry, we didn't get around to writing out detailed tutorials for iCloud yet. But the API docs are here: http://u3dxt.com/api/?topic=html/N_U3DXT_iOS_Data.htm, with the main class being iCloudPrefs, which resembles Unity's built-in PlayerPrefs. We also have a full example in Assets/U3DXT/Examples/coreextras/iCloudTest/. Please let us know if you have any questions.
     
  45. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    Ah perfect, we'd overlooked the example. Cheers!
     
  46. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    I like your "entire SDK with low and high level API" approach a lot.
    Any ETA for Android support (especially turn-based/async multiplayer and IAP)?
    And ETA of iOS iAd?
    Thanks!
     
  47. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
  48. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hi all,

    Just wondering if someone could help getting me started with this?
    I wanted to get a list of the users playlists with unityscript but I'm having a bit of trouble getting anything to work.
    Can someone give me a point in the right direction I think I'll be fine once I get going.

    Thanks
    Pete
     
  49. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I would like to Toggle the display of IOS battery status bar in Unity.

    Use Case:

    While user is playing the game, he would like to know how much battery is left. He can then make the battery status bar visible.

    Is there a specific function that can do this ?

    Cheers.
     
  50. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364