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

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

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

  1. spyder482

    spyder482

    Joined:
    Jan 25, 2013
    Posts:
    11
    My crash isn't related to IAP, but I tested anyway. Still crashes. It's very easily reproducible by just loading a scene from a scene with the WebVieGameObject in it.
     
  2. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Changchun When you call IAPXT.RestoreCompletedTransactions(), it will raise the TransactionCompleted event for each product non-consumable bought. At the end, it will raise the RestorationCompleted event. So, your codes there should handle it correctly.

    @rocki Noted. Thanks again for your interest.

    @spyder482 What device and iOS version are you using that has the web view crash? Is it consistent? Can you attach crash logs from Xcode? Thanks.
     
  3. martdob

    martdob

    Joined:
    Aug 30, 2012
    Posts:
    32
    Hi u3dxt,

    great plugin!

    I am trying to open a video file stored localy in my photo album. I am using the UIImagePickerController Class.
    The documentation says:

    However, the dialog box does not let me pick the desired movie file. How can I do that?

    Thanks!
    Martin
     
  4. spyder482

    spyder482

    Joined:
    Jan 25, 2013
    Posts:
    11
    @u3dxt I sent an email to support@vitapoly.com with the repro project and a crash log. It happens every time, on all devices I’ve tested (iPad 2, 3, Mini non-Retina, Air, and iPhone 5S, all running iOS 7.0.2, but I haven’t checked on iOS 6 or earlier).
     
  5. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    106
    After upgrade to 1.6.2.1 still bugs with file system in unity:

    Code (csharp):
    1. FileNotFoundException: Could not load file or assembly 'U3DXTGameKit7_HL, Version=1.6.2.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    2. FileNotFoundException: Could not load file or assembly 'U3DXTGameKit7, Version=1.6.2.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    Only after deleting examples errors gone. But another 2 errors still exist:
    Code (csharp):
    1. ReflectionTypeLoadException: The classes in the module cannot be loaded.
    2. System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/Assembly.cs:371)
    3. UnityEditor.Sprites.Packer.<RegenerateList>m__DE (System.Reflection.Assembly a)
    4. System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator14`3[System.Reflection.Assembly,System.Type,<>__AnonType0`2[System.Reflection.Assembly,System.Type]].MoveNext ()
    5. System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[<>__AnonType0`2[System.Reflection.Assembly,System.Type]].MoveNext ()
    And still error in IAP when not test account:
    Code (csharp):
    1.  
    2. app(5153,0x3b98eb88) malloc: *** error for object 0xd1630a4: incorrect checksum for freed object - object was probably modified after being freed.
    3. *** set a breakpoint in malloc_error_break to debug
    4. (lldb)
     
  6. spyder482

    spyder482

    Joined:
    Jan 25, 2013
    Posts:
    11
    @Shefich: I got the second part of that (ReflectionTypeLoadException) too. I had to reimport the project to fix it in order to use the Sprite Packer again... Not sure it's related to U3DXT though
     
  7. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @martdob The default media type that the UIImagePickerController shows is image. You can set the mediaTypes to include movies:
    Code (csharp):
    1. UIImagePickerController picker = new UIImagePickerController();
    2. picker.mediaTypes = new string[] { "public.movie", "public.image" };
    @Shefich For your first error, did you import all files in the U3DXT package? If so, does reimporting also fix it?
    For your third error, we are not able to reproduce. Can you attach the call stack or other crash info?
    Edit: Using test account works fine, but only crashes with non-test accounts? Does it crash during init or during purchase?
     
    Last edited: Dec 13, 2013
  8. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @spyder482 Thanks again for providing us with enough info to reproduce the web view crash. We have not completely resolved the issue, but in the mean time, we have attached a workaround, which you can place in Assets/U3DXT/Prefabs/SupportFiles/uikit/. It delays loading the web view so everything native is loaded after the scene. The problem was actually the Unity splash screen was not fully unloaded before the web view was created.

    View attachment $WebViewGameObject.cs
     
  9. Yuuki-Mochiduki

    Yuuki-Mochiduki

    Joined:
    Nov 29, 2012
    Posts:
    11
    Thank you for your great plugin.

    I use AssetLibrary. When I call this code, my app will be crushed.

    string albumName = (string)assetsGroup.Value(ALAssetsGroup.PropertyName);

    When I use my album's name that is in English, the code has no problem.
    But when I access to the Japanese named album, the app will be crushed.
    It may be cause by multibyte characters. That crush point failed to process of "malloc".
     
  10. Joskym

    Joskym

    Joined:
    Oct 2, 2013
    Posts:
    39
    Hi,
    I have some problems with iCloudPrefs.
    I'm using it to store some key/value pairs.
    Unfortunately, sometimes it doesn't synchronize in time.
    I'm checking if a key exists with HasKey function and it return false, but when I get the value after that, it returns the right value.
    I tried forcing the sync with Synchronize function but it doesn't work any better.
    However, sometimes it works well, it's a little bit random...

    Help pleeeaaaaase :'(
     
  11. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    106
    For my first error: this can be fixed when you delete all files from samples folder. Or just from gamekit sample.

    For my third error: it only crashes with non-test account during purchase(when i press buy button on IAP confirmation Uialert).
     
  12. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    HI,

    I don't know if this is reported already. But i'm using NGUI for my GUI. But when I import U3DXT from the asset store i'm getting a lot of Ambiguous Reference exceptions on for instance UILabel :( . This is only in the latest version of U3DXT as i'm still using an older beta version of U3DXT which works perfectly with NGUI.
     
  13. gnark

    gnark

    Joined:
    Feb 1, 2013
    Posts:
    3
    Hello-

    Still working my way through implementing one of the plugins modules in my project (GameKit). I was having issues with my app crashing when I would call:
    Code (csharp):
    1. TurnBasedMatchesController.LoadAllMyMatches(CallBackFunction)
    I discovered on this thread that the asset store downloads 1.6.0.0 instead of 1.6.2.1 (the latest), and saw that there may be an update that would fix this. I've updated to the latest, and this appears to fix my issue, but has caused a couple of minor annoyances in the process that I thought I'd bring up.

    1.6.2.1 Examples Have Errors?
    The examples appear to have compile errors that cause my project to not build (and I see this on a brand new project with nothing but U3DXT in it). An example is:
    Code (csharp):
    1. Assets/U3DXT/Examples/KitchenSink/KitchenSink.cs(5,24): error CS0234: The type or namespace name `AudioToolbox' does not exist in the namespace `U3DXT.iOS.Native'. Are you missing an assembly reference?
    Xcode Warns on Missing Example Files If Examples Removed
    So I deleted that example, only to find other examples were giving me similar issues. So I deleted the entire examples directory. My project now builds, and the issue I had hoped to fix appears resolved, but now Xcode informs me that I have like 133 missing files, because for some reason it thinks I need all the Example files? (I'm relatively new to Xcode/iOS stuff, so maybe there's something I can do to tweak that but am unsure)

    I'm currently using Unity 4.2.2f1 and Xcode 5.0.2. If I can provide any other info just let me know. Thanks.
     
  14. gnark

    gnark

    Joined:
    Feb 1, 2013
    Posts:
    3
    @Tripwire - I had this issue as well (with no working beta U3DXT to fall back to). I ended up going into NGUI and adding a namespace to the NGUI.UILabel class, and then updated all NGUI files that utilize UILabel to have use that namespace. Solved the problem for me.
     
  15. gnark

    gnark

    Joined:
    Feb 1, 2013
    Posts:
    3
    Figured out part of my issue, with the Xcode warnings. Those were coming from my SVN repo, and Xcode is aware that something was out of sync. Once I actually svn deleted the examples, Xcode didn't warn of those missing files anymore.

    The Examples still are throwing compile errors for me though.
     
  16. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @gnark, @tripwire Concerning UILabel; NGUI is using the global namespace so it conflicts. In C#, gnark's workaround works well. But in Javascript, Unity3D auto imports namespaces and causes a conflict. We've recently submitted a bug report to Unity3D concerning this issue, but it may come down to us changing the UI component names (which sucks because it won't be the same as what Apple calls them) or fixing NGUI. We are waiting for Unity to respond first, but if you need an older build, please send me a PM.

    @gnark For the compile errors in Example, try removing the U3DXT folder and then import the asset again.

    @Shefich When testing IAP, test accounts are required. We'll add in additional checks and show a debug message on the next build if you use a regular account in sandbox mode (Apple doesn't let you test IAP with real accounts).

    @Joskym iOS iCloud synchronization is asynchronous and happens when the operating system schedules it. Subscribe to the NSUbiquityIdentityDidChangeNotification event to handle synchronization events.

    @Yuuki.Mochiduki I am looking into this issue now.
    EDIT: We verified the crash, it doesn't appear to be related to multibyte strings. Will update again when we find a solution. Thanks for reporting it.


    EDIT2:
    @gnark, @tripwire Unity responded namespace issue in regards to Javascript. Hopefully the bug will make it to the public issues list and then we can vote to have Unity fix it.
     
    Last edited: Dec 16, 2013
  17. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    When using the the WebKit. Is it possible to open a pdf file inside that web view? Or will the user have to open it up in iBooks or something like this?
     
  18. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    215
    I just bought U3DXT. I bought it mainly for MapKit. Can you tell me when this might be available? I need to be able to drop annotations with custom images and get notified when the user selects one. I also need the address to pop up when the user taps an annotation.
     
  19. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    215
    Please change the colors in the source code images in the PDF documentation. I can't read it at all.
     
  20. regy42

    regy42

    Joined:
    Feb 16, 2013
    Posts:
    8
    Dear developers, I found your nice plug-in. Currently I need only in app, so I try free version of your plug-in. I import it and try to build your test scene but after that I cant open project in Xcode (project cannot be parsed). I use Unity 4.3.1 and the last xcode. Its second in app plug-in I try and same issue. I use also facebook sdk and official admob plug-in which works well. Coud you help me please?
    Thanks
     
  21. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Fred'sIphone Yes, you can load PDFs into a WebView.

    @Hotshot10101 We are currently building out the rest of AVFoundation. Unfortunately due to it's size, it will be another couple of months before we can start on new frameworks. I will ask our CTO to take a look at MapKit, if it's just a couple of days of work, we'll do the low-level for you. Sorry about the color scheme in the docs; the docs are also available in http://www.u3dxt.com

    @regy42 What is the full path to your XCode project? Are you using our plugin with other plugins at the same time? Is the build folder outside of the Project folder?
     
  22. regy42

    regy42

    Joined:
    Feb 16, 2013
    Posts:
    8
    @u3dxt Thanks for a fast reply. My original path was /Users/Macbook/Unity/Extreme Demolition 2 – update for Unity project and /Users/Macbook/Unity/Extreme Demolition 2 xcode for build project. So this might be a problem, I move it to /unity/ed and /unity/edunity and now it can be builded in xcode. But when I run app on iPad, app shut down as soon as I see test buttons. Bundle Id on iTunes and in unity is cz.kablik.ed and id of the in app is cz.kablik.ed.noads. Is there some other codes and ids that must be filled? Is it works in test mode if status of the app is prepare for upload and ready to submit on in-app? When I build project and run it with cable connect to macbook, app pause and there is some error but I absolutely don`t understand what the error say. Can I take screenshot or something? Thank a much for your helpfull reply.

    I use facebook original plugin and AdMob original plugin, but now I test build only your test scene with my product id.

    You are a first who really help me :).
     
  23. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @regy42 Glad I can help. In order to test inapp purchases, you must use a test account. This video shows you how to create a test account: http://www.youtube.com/watch?v=jwYnCARhtI0
    Be sure to go to settings on the device and log out first before launching your game. Then use the test accounts username and password.
    Also, please try the included IAPTest example using your bundleid and IAP ids. It will show debug messages or success messages. Please try that and let me know what the log says. Thanks.
     
  24. regy42

    regy42

    Joined:
    Feb 16, 2013
    Posts:
    8
    Thanks for answer. I created test account and login as tester. I think it works, because I try another plugin which works but when I use it, admob plugin was completely broken and the game crashes every time I try to use AdMob since I only import this plugin. So I must look for another. With tst user the situation is exactly the same. Your test scene say: can make purchase: true, purchased: false and than crash. Here is debug log http://www.cableekgames.com/ed-15.12.13-23-33.crash debug log. Please look at that. I can purchase your full plugin or make everthing to get it works, because this implementation waste many hours (build-wait-build-wait-....). Don't be afraid about time in debug log, I am from a central Europe :)

    Thanks
     
  25. Joskym

    Joskym

    Joined:
    Oct 2, 2013
    Posts:
    39
    But what append if the key really doesn't exists? The event is never fired right?

    EDIT: I did something like this :
    Notif is never called. Did I miss something?
     
    Last edited: Dec 16, 2013
  26. DevDuFF

    DevDuFF

    Joined:
    Jan 3, 2013
    Posts:
    17
    I can't get the WebViewTest demo to work. Followed the tutorial to see if I was missing anything but nothing is jumping out at me. I see the GUI buttons, but the web view doesn't display. Just a default blue background. No errors are thrown. I'm using Unity 4.3.1, Xcode 5.0.2 and U3DXT Pro 1.6.2.1. Let me know if I can provide any more information. Thanks for your help.
     
  27. ZerkyWerky

    ZerkyWerky

    Joined:
    Apr 2, 2009
    Posts:
    129
    How do you check if an achievement has already been given or get current progress and also how to you get the players score from the leaderboard?

    I think you should change your Player class to GKPlayer or something as it is a common class for ppl to create and your kit conflicts it.
     
  28. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @regy42 Can you comment out getting the .localizedPrice in your code? From the code base, it looks like we recently moved that portion of the code to be handled natively. Btw, what is your country code?
    EDIT: I've just been informed that version 1.6.3.0 fixes this issue based on the stack trace. What version is our plugin?

    @Joskym I will write a tutorial example today on iCloud.
    EDIT: Actually, we have a high level way of doing it, please see U3DXT/Examples/coreextras/iCloudTest in 1.6.2.0, or check out this code: http://pastebin.com/T1qT3ihR

    @DuffOwNz Are you testing on device, simulator, or Unity Editor? Also, the webkit coordinates are in points not pixels.
    EDIT: http://answers.unity3d.com/questions/598820/webview-not-working-in-u3dxt.html

    @ZerkyWerky In order to access the information programmatically, you will have to use the low-level API. Here is a link to an example of getting the player objects from the leaderboard: http://u3dxt.com/docs/gamekit#tab3
    We will consider changing the Player class name, but we have many people using the plugin already and it's properly namespaced. So, I want to assess the impact first. But I can totally see where you are coming from.
     
    Last edited: Dec 19, 2013
  29. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    Hello Wonderful People,

    The forums are getting a bit messy. I want to improve support by using answers.unity3d.com.

    So, if you still have an outstanding question, please tag the question "u3dxt" and ask it here: http://answers.unity3d.com/questions/ask.html

    Important: Please be sure to tag it with u3dxt otherwise we won't see it.

    Thanks!
     
  30. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    I have some warnings with iAD ( I dont use them) any idea how to fix this ? or is it harmless?
    $error xcode.jpg
     
  31. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Changchun The iAD stuff are not our code. However, this is harmless. Apple deprecates APIs from time to time, but they keep them around for backward-compatibility.
     
  32. iciller

    iciller

    Joined:
    Jun 1, 2013
    Posts:
    6
    Hi guys,
    you are smart aliens from another planet and are doing a great job. But, I don't know anything about low level iOs programming. I would be very grateful if you can show me how to read baterry level on iphone/ipad.

    Thanks!
     
  33. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
  34. Tripwire

    Tripwire

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

    To get back on my issue with the ambiguous reference exceptions. I downloaded beta 1.2.90002 (latest beta) and that one doesn't give me any errors too. Just the version from the asset store.

    Another question, i've been away for a while from this topic, but i'd like to know if the native pickers are available (date picker is but i'd like to make a picker with my own texts).
     
  35. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,455
    Two Questions:

    1. How to get access to the beta.
    2. How to use the photo album picker to select photos and videos from IOS into Unity.

    Cheers.
     
  36. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Tripwire @rocki, the beta version is old. We are currently not using the beta program, but we may again in the future. If you or anyone want to try all features before purchasing U3DXT Pro edition, the Basic edition is available for free.

    @Tripwire the old beta version doesn't have the new UILabel and other new features. That's why it doesn't give you the ambiguous error.

    @rocki Assets/U3DXT/Examples/core/GUIBasics has example code on how to do pick from photo album.

    BTW, for a better way to organize the questions/support for U3DXT, you can post your questions here on http://answers.unity3d.com/questions/ask.html, and tag it with u3dxt. Thanks.
     
  37. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    I have problem with the Webview.

    In my game I instantiate the Webview Prefab when the play presses a button. But when I do it there is no web view getting loaded. I get the navigation button but not the web view itself.
     
  38. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Fred'sIphone Unity does not support native plugins in the Editor. It can only be tested on a physical iOS device.
     
  39. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    I actually was aware of that so I already tried it out on the iPhone. But it didn't work there.

    So currently I solved it by having the prefab in the game the whole time and just hiding the web view while it isn't needed. I hope that it the impact on the performance isn't too big.
     
  40. MWorks_2012

    MWorks_2012

    Joined:
    Dec 3, 2012
    Posts:
    2
    I was trying to buy your plugin in Unity3D asset store, with paypal. I wasn't able to finish my purchase, and I need some help before the promo is over (30 usd). Can you help me? maybe sending it to your paypal account directly? thanks!
     
  41. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @Fred'sIphone It's possible to not load the webkit until you need it. Please see the code in this example. You can also remove the prefab. Please make sure that you have the newest version of U3DXT if you are using Unity 4.3.1.

    @MWorks_2012 We prefer people to use the Asset Store. But if you must use pay pal, we've provided some instructions in the answers area.. Thanks!
     
  42. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    .
     
    Last edited: Dec 26, 2013
  43. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @TokyoDan Our plugin does not require Prime31 StoreKit or NGUI; it is a standalone package. Where is this misinformation from?
    If there is a conflict with our package and another package, we will try to resolve it for you. For example, recently, we opened up more of UIKit, which includes a class named UILabel. This class conflicts with NGUI because NGUI isn't using proper namespaces. One possible fix is for us to branch NGUI's source code and properly namespace their components but that means whenever NGUI makes code changes, we will have to update our version of NGUI for you; this solution is ineffective, violates the Asset Store EULA, and will cause headaches for all involved. Instead, we've contacted NGUI and submitted a bug to Unity so we can properly workaround namespace conflicts. In the meantime, we will allow you to disable our UILabel component if you wish to use NGUI's.

    We will try our best to resolve conflicts with different vendors and have been successful in the past. If you are concerned about conflicts with various packages, please try our package out for free first before you send us money. Feel free to come and ask questions anytime. Thanks.
     
  44. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Last edited: Dec 26, 2013
  45. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Hello @u3dxt There is just one thing I wish you could change. The text on black background for the sourcecode listings in the docs which is completely unreadable on both my 27" iMac and my Retina iPad Air.
     
  46. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    Is it possible to display a guitexture above the Webview? Because I need to show some text in the tutorial and it is actually hidden by the web view :(
     
  47. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @TokyoDan You can view the docs online: http://u3dxt.com/docs, http://u3dxt.com/docs/api.

    @Fred'sIphone The native webview cannot be drawn below the Unity layer. If you want something on top of web view content, you will need to add it within the web view as an HTML div/image.
     
  48. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    That is better but sometimes I want to study stuff on my iPad when I'm on the train. And my iPad has only wifi. The train doesn't.
     
  49. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Hello.

    In your following post you mentioned; "we will allow you to disable our UILabel component if you wish to use NGUI's.".

    As I am heavily using NGUI please tell me how can I do this .


     
  50. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    @TokyoDan Are you using C# or UnityScript? If C#, you will get an ambiguous UILabel warning but it will work fine. If UnityScript, we are still beta testing current build to make sure the workaround works well in the supported versions of Unity.