Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  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. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    Instead of renaming folders or files, how about using a '.disabled' folder since Unity ignores folders that begin with a '.'. Then move the disabled files into this folder.

    http://answers.unity3d.com/questions/288864/isnt-there-a-do-not-compile-folder.html

    Just tried this with a .test folder and Unity Editor doesn't seem to pick up the folder or any files inside.

    Workflow-wise, when the user changes which modules to enable or disable, pop up a dialogue to show the list of affected files and ask the user if they would like the plugin to move (or remove) the files automatically or let the user manually use SVN operations to do so. Even better would be a way to save this preference.
     
  2. amanmathur

    amanmathur

    Joined:
    Jul 17, 2013
    Posts:
    5
    Hello, I want to take a Texture2D out from the Photo Library. Can you share the code/tutorial to do that. The code posted earlier did not work for me. Can you please share the entire code?
     
  3. Dambusters

    Dambusters

    Joined:
    Jan 6, 2012
    Posts:
    52
    Hi, Thanks for the prompt reply and BTW, well done on your delivering an ever expanding list of functions, I don't think I've seen any other developer adding so much so rapidly (very glad I got in early)!
    My problem is that your C# examples makes extensive use of delegates (e.g. to check if a transaction went through OK), which I didn't know you could subscribe to in Javascript. On doing some further research I discovered that it is possible to subscribe to C# delegates from Javascript (but not to declare them). I'm not sure of the syntax to do this and while I could spend some time trying to figure it out, a few examples of doing this would be most helpful to me and any Javascript developers trying to use your code as it's not something most are going to be familiar with.
    Maybe you could post an example of how to subscribe to IAPXT.TransactionCompleted in Javascript - just one working example would be great - thanks.
     
    Last edited: Oct 17, 2013
  4. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Hi guys,
    i just bought this fantastic set and i just start learning and going through examples and tutorials.
    I just can't find how to use simple stuff like UIActivityIndicatorView etc.
    Is there any example or forum about it?
    I tried many things but get error which i don't understand and i can't see any code usage example about it.
    Thanks!
     
  5. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,271
    I just downloaded it fresh from the Asset Store the other day. When I check in the U3DXT menu, it tells me there's an update available and to download it the way I did before.

    Just imported from the store again, and that's when it told me an update was available. Now I see more examples. Still not sure what to pick when doing the import. I just want to do four things (one of which is not available yet): WebView, attach a screen capture to an email, show an alert, and show an input dialog. How do I know what package to select based on what I need to do?
     
  6. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    I just did this tutorial but i get InitializationFailed on Xcode, i'm sure i did set up all properly but no luck yet...do you have any idea what it would be?
    Definitely the bundle id and the in app purchase are ok, i can't understand what's wrong.

    I did set up the IAP on my actual app, creating an update and adding the IAP to the app (obviously dod not send the app itself to apple because i need to test the IAP before).
     
  7. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @danien Thanks for letting us know about the "." folders. One problem we see is that "." folders are hidden by default, and people may not know to commit these files. We need these files to be committed so any machine can enable/disable modules and be able to commit those as well.

    @amanmathur In the latest version (1.4.1.0 now), in Assets/U3DXT/Examples/core/GUIBasics/GUIBasics.cs, there is a working example of picking photos from library. Basically, you subscribe to the GUIXT.MediaPicked event, and call GUIXT.ShowImagePicker().
     
  8. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @Dambusters Subscribing to events is the same in Javascript. You either pass it a function that is declared somewhere else or an inline function.
    Code (csharp):
    1. IAPXT.TransactionCompleted += function(sender:Object, e:TransactionEventArgs) {
    2.     Debug.Log("TransactionCompleted: " + e.productID + ", " + e.quantity);
    3. };
    Or
    Code (csharp):
    1. function OnTransactionCompleted(sender:Object, e:TransactionEventArgs) {
    2.     Debug.Log("TransactionCompleted: " + e.productID + ", " + e.quantity);
    3. }
    4. ...
    5. IAPXT.TransactionCompleted += OnTransactionCompleted;
     
  9. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @JohnB It is overwhelming that U3DXT has so many APIs that you don't know where to start, isn't it? To tell you the truth, we are having a hard time keeping up with the examples and documentation. It's easy for us to keep opening up more APIs, like the input dialog. But writing documentation and examples is a bigger task. Nevertheless, not only are we committed to making this the ultimate iOS plugin, but we will provide support as well. So, just ask here and we will help.

    To answer you questions, for web view and alerts, use the Core module, and examples are in Assets/U3DXT/Examples/core/GUIBasics and WebViewTest. For attaching screen capture to email, use the Social module, and examples are in Assets/U3DXT/Examples/social. We don't have code for capturing screening there, but you can find it somewhere else.
     
  10. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @iguana_02 How do you want to use the activity indicator? It derives from UIView, which means you need to add it to the root controller's view. Attached is the code we use in IAP high-level API, which shows a dark transparent background covering the whole screen with the activity indicator in the middle.

    For your IAP test, an InitializationFailed usually means you are not logged in as a test user. Go to the Settings app, and sign out from iTunes App Store.
     

    Attached Files:

  11. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    WOW! Thank you!

    I was using another plug in before this and when i need the activity i just added it and hide it once the operation was done.

    No xcode operation just in unity.

    Now i understand the IAP, it makes sense...i need to log out before i open the app and then log in once i click to the IAP button.

    Thanks!
    Ale.

    EDIT: I found where was the problem, don't know why but if i add the IAP to an update it doesn't work.
    I create a new TEST app on itunesconnect and created the non consumable IAP and then it works.
     
    Last edited: Oct 17, 2013
  12. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Hi, great plugin! Is there any way to just open up a webpage in the native webview (as opposed to embedding the webview inside unity?) so that I can just feed it a webpage, and Unity will be paused while the webview is shown full screen?
     
  13. yifan024

    yifan024

    Joined:
    Jun 5, 2013
    Posts:
    19
    Is there any way I can know if device connect to power or not? Or check battery level. Thanks
     
  14. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @capitalJmedia The webview we have is actually a native webview, and it is added on top of Unity. You can change its size; the prefab object also has a checkbox for full screen if you want that. But maybe leave some space for a border and X button to close it. To pause Unity, changing Time.timeScale to 0 would suffice for most cases. Otherwise, here is a good reference: http://answers.unity3d.com/questions/7544/how-do-i-pause-my-game.html.

    @solo024 In version 1.4.1.0, we added UIDevice. You can access the battery state and level like this: UIDevice.CurrentDevice().batteryState and batteryLevel. You can also subscribe to the BatteryStateDidChange and BatteryLevelDidChange events if you want to be notified when those change.
     
  15. yifan024

    yifan024

    Joined:
    Jun 5, 2013
    Posts:
    19
    @u3dxt Thanks, really helpful.
     
  16. amanmathur

    amanmathur

    Joined:
    Jul 17, 2013
    Posts:
    5
    Thanks a lot for the great plugin and support @u3dxt!
     
  17. HerculesCE

    HerculesCE

    Joined:
    Oct 8, 2013
    Posts:
    2
    I'm having a bit of a problem here.

    Whenever I try utilizing your Social plugin, I get some weird results. Running your own SocialTest-scene doesn't output any errors, but when run on my phone it simply ignores the input from all buttons, except for Email and SMS - Twitter, Facebook and so on just doesn't respond when being clicked. Nothing is logged, whatsoever, no errors, nothing. I tried writing a few logging-lines for the Facebook-button, to see if it actually just didn't register the click, but apparently it does. The following code appears to have no effect:
    Code (csharp):
    1. if (GUILayout.Button("Facebook Post", GUILayout.ExpandHeight(true))) {
    2.             SocialXT.Post(SLRequest.SLServiceTypeFacebook,
    3.                 "Text elements",
    4.                 null,
    5.                 "http://www.mylink.com"
    6.             );
    The same thing applies when reusing your own written social-code in a script for itself. No errors no nothing.

    I'm running Unity 4.2.0f4 Pro with iOS Pro, on an iPhone 5 with the newest updated iOS7 and, of course, newest version of Xcode :)

    EDIT: I figured it out - this had nothing to do with your plugin, which, hands-down, is pretty great! Before purchasing your plugin, we've been using our own superficial iOS integration at the office, and I had the old configurations, from our old integration, volume injected into my Unity Client. As soon as i turned it off and ran solely with your plugin, things worked flawlessly!
     
    Last edited: Oct 20, 2013
  18. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Is there a 'Popup' dialog or 'Rate' behavior in the Free version? I assume so, though there's a lot of libraries and docs.

    Gigi.
     
  19. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @Gigiwoo The Basic edition of U3DXT comes with the native UIAlertView, which has a high-level API GUIXT.ShowAlert(). You can call that to show the "popup". But subscribe to GUIXT.AlertDismissed event first. When the user taps on the rate button, you can call UIApplication.SharedApplication().OpenURL() passing in your app's iTunes URL (something like itmss://itunes.apple.com/us/app/<app-name>). This will open your app's page in the AppStore app. However, you can also use IAPXT.ShowStore(<itunesID>), which allows you to show your app's page within your app, which is better because it doesn't switch to the AppStore app.
     
    Last edited: Oct 20, 2013
  20. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    When I added the U3DXT Free plugin, I am no longer able to use Stripping on Unity 3.5.7. It gives that crazy error about Failed Assemblies Stripper, or other, depending on which level of stripping I have on.

    Gigi.
     
  21. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    @u3dxt
    i got the IAP working but sometimes it crashes, i think is due to the way i implemented events on the transaction successful.
    Starting from your example file (which works great) what is the best way to add more than one premium?
    I did something like this but i think that's why is crashing:

    IAPXT.TransactionCompleted += delegate(object sender, TransactionEventArgs e) {
    Log("TransactionCompleted: " + e.productID + ", " + e.quantity);

    if(e.productID==premiumProductID01){
    PlayerPrefs.SetString(productName[0],"bought");
    }

    if(e.productID==premiumProductID02){
    PlayerPrefs.SetString(productName[1],"bought");
    }
    etc etc...
     
  22. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Did you ever test with rotated iPads? It's a common mistake, and I found that running on landscape_right (with the home btn on the right), causes the StoreProductViewController.Show() behavior to be flipped upside down.

    Gigi.
     
  23. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @Gigiwoo Can you go to Assets->U3DXT->About to make sure you are using version 1.4.1.0? Version 1.4.0.0 has the stripping problem. If you are indeed using version 1.4.1.0, can you post the Assets/link.xml file that was generated?

    As for the view showing upside down, can you tell us how to reproduce it? We have tried locking the rotation and not, and it shows up correctly.

    @iguana_02 Can you post the crash call stack? From looking at your code, could it be because productName array is not initialized or out of bound? BTW, the IAPXT class already stores the "bought" flags in the PlayerPrefs for you. Check the documentation for IAPXT.HasBought().
     
  24. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    I did check all the stuff and on unity side all is fine, not out of bound or other its something that happens running on device, and the log says nothing. Consider the crash is really random, that's why i asked if the way i was using the plug in was right or there was a better way. ;)

    I used "Bought" as a sample, on my my product, already present but hidden will be unlocked only if the PlayerPrefs has key"producName".
     
  25. blindgoat

    blindgoat

    Joined:
    Oct 24, 2012
    Posts:
    31
    @u3dxt - Is there an easy way of converting low-level GKTurnBasedMatch objects to the high-level TurnBasedMatch objects? The only low-level method I find myself having to use is the GetMatches function and I want to cache all my matches as TurnBasedMatch so I don't have to deal with low-level -> high-level conversion all the time. Is that possible? Is there somewhere I can add the "high-level GetMatches" feature to a wish list?

    Thanks for the great work :)
     
    Last edited: Oct 21, 2013
  26. AndrewK

    AndrewK

    Joined:
    Sep 14, 2012
    Posts:
    38
    I wanted to test GameKit with Real-Time Multiplayer within basic version of the plugin, but even on the authentication code:
    Code (csharp):
    1.         GameKitXT.LocalPlayerAuthenticated += delegate(object sender, EventArgs e) {
    2.             Log("Local player authenticated: " + GameKitXT.localPlayer.alias);
    3.         };
    4.        
    5.         GameKitXT.LocalPlayerAuthenticationFailed += delegate(object sender, U3DXTErrorEventArgs e) {
    6.             Log("Local player authentication failed: " + e.description);
    7.         };
    8.        
    9.         GameKitXT.AuthenticateLocalPlayer();
    I got:
    $Zrzut ekranu 2013-10-21 o 12.28.09.png

    So, how can I make this work?
     
  27. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @iguana_02 Your code and the way you subscribe to that event looks fine. Are you calling it more than once? It won't crash if you do, but just something to mention. If it crashes again, be sure to let us know any error msgs or logs from Xcode Console or a call stack from Unity would be best.

    What I meant about IAPXT storing the "bought" flags was in the high-level API, before we send out the TransactionCompleted event, we cache the product ID as "bought" in the PlayerPrefs. So you don't have to cache it yourself. When you want to check if they have bought a product, you can call IAPXT.HasBought(). But you can only take the returned true value as absolute, because if it returns false, it just means the user has not bought the product on this device during this install.
     
  28. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @blindgoat Yes, you can do this easily now but may not have access to everything.

    Code (csharp):
    1. TurnBasedMatch match = NSObjectWrapper.CreateWrapper(typeof(TurnBasedMatch), gkmatch) as TurnBasedMatch;
    Internally, we also load the participants in that match with the high-level Player class. But if you don't need that, you can just use the above code now.

    BTW, we will release the high-level API source to GitHub very soon (today or tomorrow). You can then change it however you like.
     
  29. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @AndrewK The Basic edition of U3DXT comes with Core and In-App purchase for free, but you can also try out Game Kit. To do that, go to Assets->U3DXT->Select Modules..., and check Game Kit or Game Kit for iOS 7 if you have iOS 7 SDK installed. To resolve the errors, you can right-click on the types with errors in MonoDevelop, and click Resolve->using U3DXT.iOS...

    Or you can copy these statements to the top:
    Code (csharp):
    1. using System;
    2. using U3DXT.Core;
    3. using U3DXT.iOS.GameKit;
     
  30. AndrewK

    AndrewK

    Joined:
    Sep 14, 2012
    Posts:
    38


    Thank you, now authentication works (btw, I think you should add it to the tutorial)

    but unfortunately after adding this code:
    Code (csharp):
    1. localPlayer.LoadFriends(delegate(Player[] players) {
    2.     Log("Loaded friends:");
    3.     foreach (var player in players) {
    4.         Log(player.playerID + ": " + player.displayName);
    5.     }
    6. });
    I got this:
    $Zrzut ekranu 2013-10-21 o 23.20.44.png

    and in "Select modules" I can only select "Game Kit with ..." look:
    $Zrzut ekranu 2013-10-21 o 23.26.50.png
    I have Xcode 5 and iOS7
     
  31. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @AndrewK Thanks for pointing that out. We will add import statements to our documentation.

    For the crash, are you calling LoadFriends() right after you call GameKitXT.AuthenticateLocalPlayer()? Or are you calling it inside the LocalPlayerAuthenticated event delegate? GameKitXT.localPlayer is null until the local player has been authenticated. We have a few examples that you can use to jump into. They are in Assets/U3DXT/Examples/gamekit and gamekit7. They work with both GameKit and GameKit for iOS 7.
     
  32. AndrewK

    AndrewK

    Joined:
    Sep 14, 2012
    Posts:
    38
    Initially my code was like this, like in tutorial:
    Code (csharp):
    1. GameKitXT.LocalPlayerAuthenticated += delegate(object sender, EventArgs e) {
    2.             Debug.Log("Local player authenticated: " + GameKitXT.localPlayer.alias + " : " + GameKitXT.localPlayer.playerID);
    3.         };
    4.        
    5.         GameKitXT.LocalPlayerAuthenticationFailed += delegate(object sender, U3DXTErrorEventArgs e) {
    6.             Debug.Log("Local player authentication failed: " + e.description);
    7.         };
    8.        
    9.         GameKitXT.AuthenticateLocalPlayer();
    10.        
    11.        
    12.        
    13.         LocalPlayer localPlayer = GameKitXT.localPlayer;
    14.         Debug.Log("Local player authenticated: " + localPlayer.playerID);
    15.          
    16.         localPlayer.LoadFriends(
    17.         delegate(Player[] players) {
    18.             Debug.Log("Loaded friends:");
    19.             foreach (var player in players) {
    20.                 Debug.Log(player.playerID + ": " + player.displayName);
    21.             }
    22.         });
    But I have found GameKitBasics example, within gamekit7 directory (there is no any other examples). But I could not use it, because GameKitBasics.cs file name always change to GameKitBasics.cs_disabled when I compiling, but I copy that code, and tried to use it on my own. Unfortunately I got this right now:


    I only commented localPlayer.LoadPhoto section, because I had other issues related to that. So SubscribeEvents function start like that:

    Code (csharp):
    1.     void SubscribeEvents() {
    2.         GameKitXT.LocalPlayerAuthenticated += delegate(object sender, EventArgs e) {
    3.            
    4.             var localPlayer = GameKitXT.localPlayer;
    5.             Log("Local player authenticated: " + localPlayer.playerID);
    6.            
    7.             localPlayer.LoadFriends(delegate(Player[] players) {
    8.                 Log("Loaded friends:");
    9.                 foreach (var player in players) {
    10.                     Log(player.playerID + ": " + player.displayName);
    11.                 }
    12.             });
    13.            
    14. //          localPlayer.LoadPhoto(GKPhotoSize.Normal, delegate(Texture2D photo) {
    15. //              Log("Loaded photo");
    16. //              GameObject.Find("PlayerPhoto").guiTexture.texture = photo;
    17. //          });
    18.         };
    19.  
    20.         GameKitXT.LocalPlayerAuthenticationFailed += delegate(object sender, U3DXTErrorEventArgs e) {
    21.             Log("Local player authentication failed: " + e.description);
    22.         };
     
    Last edited: Oct 22, 2013
  33. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @AndrewK Do you have Xcode 5 and iOS 7 SDK installed? If so, you can use GameKit for iOS 7 instead of GameKit. When a module is disabled, all related examples are renamed to _disabled so they won't compile with errors.

    From the Xcode call stack, I am not sure where exactly does it crash. Can you build the Unity project with Script Debugging enabled? When it crashes, it gives the exact location in C# code.
     
  34. AndrewK

    AndrewK

    Joined:
    Sep 14, 2012
    Posts:
    38
    Yes, I have Xcode 5 and iOS on my device for 1000% but I can not use gameKit for iOS7 because this option is unselectable in "Select modules" menu. As I showed you in my screenshot above.

    I built my project with Script Debugging enabled, but nothing changed, I do not know how to make this work to pointing me location in MonoDevelop.

    But I discovered some strange things. And this confusing me. Normally when I am logged in to my Game Center account, I have ther some friends, and some points. But, when I am logged in there and I run my GameKitBasics project nothings happen, I mean there is no log information like "player authenticated" and so on. But after quitting this app, I am discovering, that my GameCenter account is logged out (after that GameKitBasic run). So I am trying to login in my GameCenter settings. But now, when I run GameCenter App, there is no points, no friends, and next to "ME" is "SANDBOX". And now when I run directly from iPad screen this GameKitBasics demo app there is everything ok. I mean there is log information about my id, and about my friends - which is none.

    But, when I am running project from Xcode I got this error:
    $Zrzut ekranu 2013-10-22 o 03.21.29.png
    and nothing more.

    Can you tell me what is going on? Am I misundertstand something? How can I get my friends GameCenter ID's?


    edit:
    ---------------------------
    Now it seems to be ok, I mean there is no errors, but literally nothing changed in code or anywhere. But how can I test it on my normal account (not sandboxed) with friends and all data? And is there available some basic demo how to match normal multiplayer (not turn based) game and exchange some byte data between players?
     
    Last edited: Oct 22, 2013
  35. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    Version 1.5.0.0 is now available with a new Personal module with Address Book, Event Kit, and Locations, and some recently requested features. Simply go to Assets->U3DXT->Check for Updates to get the latest.

    High-level API source code is now on GitHub: https://github.com/vitapoly/u3dxt.
     
  36. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @AndrewK You can only test with sandboxed users. That is iOS restriction.

    Under Examples/gamekit, there are two unitypackage files. They are complete working examples of real-time and turn-based multiplayer features.
     
  37. mikemvpi

    mikemvpi

    Joined:
    Dec 19, 2012
    Posts:
    7
    I've tried to update from 1.4.1.0 and after importing the package I've got:

    After restarting Unity, the error seem to be gone. But if I disable the "Personal" module and run the game, I get
     
  38. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Dear U3DXT,

    I want update you about my SVN problem.

    I alert that it was a SVN problem and his filter.
    Default settings of SVNX and TortoiseSVN indicate ".a" and ".pyc" to not include during commit.
    So each time I commit this files not be commit on server and generated conflicts.

    Then I have a question ...

    For iOS publication app, I need to check Encryption content if I use your SDK?

    Thanks
     
  39. Dambusters

    Dambusters

    Joined:
    Jan 6, 2012
    Posts:
    52
    Hi U3DXT,

    Thanks for your help, I guess this is probably another question with an obvious answer but anyway:

    I'm attempting to get IAP working using the IAPTest script but when I'm asked to login (after clicking on buy or restore) I'm not given a chance to enter my test user ID - just a single field and a request for the default user password. I've log out of the Game Center in settings but it still seems to want to use the default account.

    How can I force it to give me the same SIGN IN menu you get in the demo video, with Create New Apple ID option so I can enter my test user account?
    Is there something I need to set in your code or Xcode to tell it I want to use another user in Sandbox mode?

    (unity 4.2.2f1, Xcode 5.0, iOS7.0.2)
     
    Last edited: Oct 22, 2013
  40. mikemvpi

    mikemvpi

    Joined:
    Dec 19, 2012
    Posts:
    7
    For TortoiseSVN you may change the default settings quite easy: Settings>General>Global ignore pattern - just remove the ".a" and ".pyc" from there.
     
  41. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Yes I know NOW, but after two weeks XD
    I was mad because each time I tried to share IOS SDK library on other machine using svn I received conflicts.

    Just now I discover that the cause was SVN filter settings ... and I wanted share my solution on this thread :)

    Svn filter settings cause conflicts with all lib.a :)

    Then ... together to encryption info, I want know if it is possible save any image in iPhoto using iOS SDK (and then share on Facebook).

    Thanks
     
    Last edited: Oct 22, 2013
  42. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @kaz2057 @mikemvpi Thank you for pointing out the SVN default filter with .a and .pyc files. It could actually be the cause of many issues we have seen. I suppose git and other repositories might have similar filters.

    @mikemvpi It's probably better to remove the whole Assets/U3DXT folder and then import U3DXT again. You can find the downloaded version 1.5.0.0 in your temp folder/U3DXT (cd $TMPDIR/U3DXT).
     
  43. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @kaz2057 The IAPXT high-level class uses some encryption (System.Security.Cryptography in mscorlib.dll) to cache the products the user has bought. Now that the source is available on GitHub, you can take it out if you want.

    Yes, you can take images from the Photo Library and share them on Facebook. You would use GUIXT.ShowImagePicker(), GUIXT.MediaPicked event, and SocialXT.Post(). Take a look at Examples/core/GUIBasics and Examples/social/SocialTest. SocialXT.Post() currently takes a Texture2D. and GUIXT.MediaPicked event returns an UIImage. Converting from UIImage to Texture2D is an expensive process because it needs to upload to GPU. If you don't need the image in a Texture2D, you can modify Post() or use its source to accept an UIImage instead.
     
  44. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @Dambusters In-app purchase is a pain to setup and get it working right. A few things:

    - Make sure the product IDs in IAPTest.cs are changed to the product IDs you setup in iTunesConnect.
    - Make sure the Bundle ID for the Unity project matches the one you setup in iTunesConnect.
    - Before launching the app, go to your device's Settings app->iTunes App Store, and sign out there.
     
  45. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Thanks for explanation but I need for something different :)

    I need to take a screenshot from my game, save in photo library and then, if it is possible create a share with facebook :).

    Thanks
     
  46. Dambusters

    Dambusters

    Joined:
    Jan 6, 2012
    Posts:
    52
    Thanks, that last one did the trick! Didn't realize I had to log out iTunes App Store in addition to the Game Center.
    It works fine now.
     
  47. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    318
    @kaz2057 Please take a look at the end of page 7 of this thread. We have provided some code on how to take screenshot and share. To save to photo library, we currently don't have a high-level API yet, but you can use the low-level API ALAssetsLibrary.WriteImageDataToSavedPhotosAlbum() or WriteImageToSavedPhotosAlbum(). We will provide a high-level API in the next version.
     
  48. plasticYoda

    plasticYoda

    Joined:
    Aug 20, 2013
    Posts:
    62
  49. AndrewK

    AndrewK

    Joined:
    Sep 14, 2012
    Posts:
    38
    Thank you for the explanation. Examples works fine, but, could you make tutorial how to do the same things, I mean mathing players, but without Game Center GUI (with your own GUI)?
     
  50. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    A)

    Sorry for my ignorance :)

    What do you mean? How can GitHub help me? Can you explain me all the step to disable encryption please?

    B)
    iOS SDK support also stripping "micro mscorlib"?

    C)
    Can you explain me why you use Update or PostRender function?
    http://unity3d.tutsmobile.com/how-to-take-a-screenshot-and-share-it-on-ios/
    I think is bettere use a IEnumerator function with yield.

    Example:

    public void grabImage (UIImage image) {
    SocialXT.Post(SLRequest.SLServiceTypeFacebook, "Check out my screenshot!", image,
    "http://www.u3dxt.com", true);
    }

    public IEnumerator OnPress (bool isPressed) {
    Application.CaptureScreenshot("screenshot.png");
    yield return new WaitForSeconds(2F);
    UIImage tmp = new UIImage(Application.persistentDataPath + "/screenshot.png");
    if(File.Exists (Application.persistentDataPath + "/screenshot.png") grabImage(tmp);
    }

    What you think about?
    PS: I use OnPress() NGUI function for gui interaction
     
    Last edited: Oct 23, 2013