Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Closed] Etcetera Plugin Live! Alerts, prompts, loading views, push, localization and more!

Discussion in 'iOS and tvOS' started by prime31, Oct 18, 2010.

  1. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Andrea, have you tried doing File.Exists( sFile ) or Debug.Log( sFile ) to double check that the path is correct?
     
  2. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Hi Prime ;)
    I've got all your awesome plugins, once and for all ;)

    I'm really happy with my purchase, they are all working nicely, that is really appreciated :) Thank you very much dude :]

    I'm looking for other features/possibilities as well :) Is this possible to turn Unity3D main view/frame like the other apps do? (A.K.A AutoRotation)

    I was wondering if that is possible and btw, why on earth does this happen? You have coded your app/game (on iPad for example) you set the orientation and stuff but just try to lower/higher the volume and you'll see that the volume icon does not change!!! Is there any way to get this things done? I believe you're working on a plist visual editor right?

    Thanks in advance
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Curious, thanks for the kind words and glad you are liking the plugins. The beginnings of the pList editor are available with the latest versions of the GameCenter and Etcetera Plugins in the new Prime31 menu item. As for the autorotation issue, this is something I have been fighting with since the beginning of time. Unity does not put the game view inside a ViewController but they do put the keyboard view in one which leaves a very disjointed system to deal with. If they exposed a bit more of what they were doing there (that goes for audio as well) instead of locking the code away in static libraries it would be easier to fix the issue. I have done some experiments sticking the Unity game view in a ViewController proper and it kind of works, but not fully do to Unity's bullish handling of the rotation system. Hopefully one day they will just put the view in a ViewController and let it rotate around like the rest of the iOS apps out there.
     
  4. Deleted User

    Deleted User

    Guest

    I just added the plugin, for the photo selector, to my maze app. Works great! (there's a pause after selection, but in this context I think it's OK). I like the camera option - here's a test with my takeout dinner:
     

    Attached Files:

  5. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @technicat, mmmmm. French fries. Must go find french fries.

    The pause will vary based on iOS version and phone. If you are using 4.0 or greater, all image resizing and saving to disk occurs on a background thread. The little pause still happens though and doesn't appear to be fully avoidable (at least until we get the iPhone 5 with more RAM and a faster processor).
     
  6. Deleted User

    Deleted User

    Guest

    I'm using your imageresize function, specifying 256x256, instead of the promptForPhoto scale factor, so maybe it's taking longer that way. I was worried about the scale factor shrinking it too much or too little depending on what the user chose, but I don't know, maybe it would actually work out better. I'll try that out next update.

    Edit: Actually, I misspoke - I'm not noticing a significant pause in the sense of an app-freezing pause, but rather a noticeable length of time for the background thread to apply the new texture. Not a big deal, I can put a "loading..." message up.
     
    Last edited by a moderator: Nov 2, 2010
  7. gazbushell

    gazbushell

    Joined:
    Feb 5, 2009
    Posts:
    53
    Firstly, i love the plugins! and if any one, like me, was wondering if they were worth it , they totally are.

    Any way I am slightly confused with showBezelActivityViewWithImage possibly in how i am referencing the image. The documentation just says to include the image in xcode and I believe i have done so and I have tried variations on the imagePath but it still won't appear.
    EtceteraBinding.showBezelActivityViewWithImage("Loading ...","pig.png" );
    does it need "@" or a "file://" or anything

    Thanks
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gazbushell, you will need the full path to the image without any file:// stuff in the front. For example, if you Debug.Log or check the value of the path in the debugger it should look something like this:

    /Users/YOUR_NAME/Library/Application Support/iPhone Simulator/4.0.2/Applications/ADC71243-8B03-4675-B9F5-3CAA2DED6A00/WWWWW.app/somePrettyImage.png
     
  9. nada

    nada

    Joined:
    Sep 30, 2010
    Posts:
    20
    hi prime

    i'm coming from flash and just startet using unity, so please be gentle...

    i sucessfully implemented your fabulous etc plugin [fist try a success, really cool work there :) ] using remote notifications via UA. what i like to do now is react inside the game depending if it was just started normal, or from within the push notification.
    i started to modify AppController.mm where i replaced the applicationDidFinishLaunching metho with application:didFinishLaunchingWithOptions so i can get info if i am launching from a notification or not. beeing a total noob in objective-c i have now 2 questions you may answer easily:
    1. how can i pass unity the dictionary my finishlaunching method is getting?
    2. when the game is just in background, not closed, how can i catch the notification info and pass to unity?

    my current AppController.mm mod:

    Code (csharp):
    1.  
    2. - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    3. {
    4.   printf_console("-> application didFinishLaunchingWithOptions()\n");
    5.   //get the notification infos
    6.   NSDictionary *remoteOptions = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    7.   if (remoteOptions) {
    8.     printf_console("-> got some remote notification data()\n");
    9.     //now how to pass this to unity?
    10.   } else {
    11.     //just for debugging purpose
    12.     printf_console("-> no remote notification data recieved.\n");
    13.   }
    14.    
    15.   [self startUnity:application];
    16.  
    17.   // haven't figured out yet if i have to return YES or NO here
    18.   return YES;
    19. }
    20.  
    21.  
    any help is appreciated!

    thanks a lot and again: cool stuff

    grx
    nada
     
  10. gazbushell

    gazbushell

    Joined:
    Feb 5, 2009
    Posts:
    53
    Thanks for this will try it out
     
  11. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nada, it is pretty advanced stuff what you are trying to do there. You can use PlayerPrefs on the Unity side and NSUserDefaults on the Obj-C side of things. They are both the same. You can't get a dictionary using PlayerPrefs though so you will want to strip it down to just strings if possible.
     
  12. Bububear

    Bububear

    Joined:
    Mar 1, 2009
    Posts:
    106
    Hi Prime31,

    I just purchased your Etcetera package and have been attempting to get MSAA running on Unity iPhone 1.7.

    Unfortunately, while Building from XCode, I've been getting the following 4 errors (please see screenshot below)



    Any ideas? :confused:
     
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Bububear, any reason you are building for 4.0? You should always set your Base SDK to the latest release (4.1 or 4.2 if you have the GM). Give that a shot and see if it does the trick.
     
  14. nada

    nada

    Joined:
    Sep 30, 2010
    Posts:
    20
    @prime31 yes, the NSUserDefaults/PlayerPrefs solution i already found googling for passing info back and forth. for me, it's important to react on the 'view details' button of the remote notification different when the app is active / when it's inactive and depending on the nofitications content. but this would be a solution (i think not the most elegant, but at least a beginners one). i'll try and if i succed will post the results in case anyone is also interested.
    tnx + grx. nada
     
  15. crevelop

    crevelop

    Joined:
    Nov 9, 2010
    Posts:
    13
    Planning on buying your plug-in, it is definitively full of great features that I will eventually use. However, I'm struggling with a new project of mine, and I'd like to know if your plug-in could sort this out as well.


    Basically I'm building a 3D Art Gallery, where most of the Art items(2D Textures) are stored in my unity project. So far I can handle almost everything, but need an extra feature:

    1 - Select one or many items from the gallery(Unity project) - Done
    2 - Attach them to an email and send them(mail.app)

    What I've read so far in the forums is for creating an email only(no attachment), something like this:

    Application.OpenURL("mailto:recipient@example.com? subject=hi!&body=Text%20goes%20here!%20");

    Works Great, opens the iphone mail.app and creates the mail format I wanted.

    But how would I include some of my Art items(2D Textures, jpg, PNG, etc) as an attachment??

    Maybe your Plug-in can make it happen???

    Remember the "art items" are stored within unity, so I have no access whatsoever from xcode to such files.
     
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @crevelo, the Etcetera Plugin currently only support emailing a screenshot.
     
  17. spentak

    spentak

    Joined:
    Feb 11, 2010
    Posts:
    246
    Prime31,
    Nice plugin. Got it for the "rate this app" feature. It works fine, but I can't get it to take me to the app review section when you click "Yes rate this app" from WITHIN the iphone game.

    Here is the link I use:
    "https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?id=400289406&type=Purple+Software";

    That link, when pasted into firefox takes me right to the game review section in the web browser on my computer, but does NOT work when done from within the game.

    This does not work either:
    "itms://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?id=400289406&type=Purple+Software";

    Itunes loads and then says "Could Not Load Itunes Store";

    My account on the device is logged into iTunes. What am I missing here?

    I have followed this http://bjango.com/articles/ituneslinks/ exactly as stated (I think) and again it will work in the web browser and itunes on my computer, but not from the phone.
     
  18. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Question about multisampling - is it limited to particular iOS devices? If so, does it fall back gracefully on older devices?

    Sorry if this was answered somewhere. I scanned through and couldn't find it.
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gappetto, multisampling is limited to certain device/iOS versions. It will do nothing at all on unsupported devices so it is safe to turn it on for all devices.
     
  20. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Cool - thanks! Just purchased.
     
  21. Bububear

    Bububear

    Joined:
    Mar 1, 2009
    Posts:
    106
    Hi Prime31,

    I'm still getting the same 4 errors (screenshot few posts above) after upgrading to SDK 4.1.

    Any other ideas? Have you sucessfully tested MSAA on Unity Iphone 1.7?


    Thanks.
     
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Bububear, I don't have 1.7 around to test but if you could email me a copy of the standard AppController.mm file I can do some tests and see what in the patch process is going wrong. I assume it is because 1.7 had a slightly different AppController file which is causing the patch to not successfully complete. (email is questions at prime31.com)
     
  23. nada

    nada

    Joined:
    Sep 30, 2010
    Posts:
    20
    hi again prime31

    i have a problem and a question regarding the mail composer call:
    1) in the EtceteraDocs there's a method
    Code (csharp):
    1. public static bool isEmailAvailable()
    which is not available in the plugin...
    is this really not available or just gone forgotten implementing? would love to have it exposed.

    2) more severe: if i call showMailComposer and then cancel the action and then recall showMailComposer i can see the composer sliding up, but then the app crashes. i tried quite a few times and the same behaviour evertytime. when i start it from xcode the only message i see in gdb is
    thanks for any hint
    grx
    nada
     
  24. byerdelen

    byerdelen

    Joined:
    Mar 27, 2010
    Posts:
    68
    Yes, I have the same problem.
    I have working links of my app but no chance that I can use it for review.
    Have you found a solution marklennartprice?
    If not, help from prime31 would be so appreciated
     
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nada, the EtceteraManager exposes isEmailAvailable. I'll see what I can do about reproducing the crash you are seeing and getting a fix out.
     
  26. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Just purchased, and was playing around with the included test scenes. Very useful, but I have some issues:

    I set it to "landscape" by pushing the button, but sometimes the alerts etc still showed up in portrait. I noticed this happens with the Unity keyboard too sometimes...
    Maybe it's an option to tell the plugin somehow which orientation it should be in, instead of using the "iPhoneKeyboard.autorotateTo..." options?

    Also, the Rate this App doesn't seem to show up every time.

    And finally, is it possible to show the web view and mail composer in landscape?

    Thanks!
     
  27. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Here's how to recreate my first issue:
    Build the app ( landscapeleft), open it while holding the device in portrait, and make an alertwindow appear. Sometimes it will be in landscape, sometimes in portrait. If it's in landscape, rotate the device and rotate it back so the alert is in portrait mode.
    Keep holding the device in portrait mode, close the alert, go to scene 2 and click the landscape button.
    Then go back to scene 1, and make the alert appear again.
    On my device, it is still in portrait mode. If I then rotate to landscape, it rotates along, and then stays in landscape when I rotate back to portrait. This is not ideal, but as I mentioned, I've seen the keyboard behave in a similar way. It might be a Unity-problem, but I hope it can be fixed for this plugin.

    Thanks!
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Smag, due to Unity not using the built in iOS view controller and autorotation system there is not way to gain precise control over orientation. You will need to use the iPhoneKeyboard orientation property for displaying anything in the orientation you desire. Whatever orientation the system prompts (such as volume) and the keyboard is in will be the same for any views the plugin injects. I highly recommend putting in a feature request with Unity to get proper, native orientation handling added to Unity.

    The RateThisApp feature purposely doesn't come up every time you call it in order to not annoy users and to make it a simple one line call in your game. If you want to augment the way the feature works there are some easy to find numeric calculations happening in the isAppEligibleForReviewWithLaunchCount: method that you can modify.
     
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Smag, grab the latest update with your original download link and the mail composer issue should be fixed. I still have to test on a couple more devices so do let me know if it does the trick for you.
     
  30. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Ok, thanks, I'll try it tomorrow.
    Will the web view also be updated like this?

    And thanks for explaining the RateThisApp thing, makes sense. I thought I would have to make sure it isn't shown each time myself, but it's good that the plugin already takes care of this for me.
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Smag, the fix should work for all the view controllers that caused a crash. The fix does not do anything for orientation though because it is out of my direct control until Unity either exposes some functions to C/C++ or uses a view controller wrapper.
     
  32. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
    Hmm, I didn't experience any crash so maybe you meant to address someone else? :)

    But the normal alerts and confirmation windows do rotate, and the webview and compose windows only show up in portrait, is there really no solution to that? Maybe by hardcoding it somewhere in the plugins myself? The web view was one of the main reasons I bought it (but even if I can't use it in landscape I don't regret the purchase).
     
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Disregard that one Smag. The fix goes out to my man @nada. The orientation of any views that a plugin shows should be aligned with the iPhoneKeyboard (if you watch the annoying black frame as you rotate your phone around you will be able to predict the orientation of the view). Set the iPhoneKeyboard to only use landscape and you should be good to go. There is no elegant way to hardcode orientation. If Unity used a proper UIViewController to display the game view all orientation issues would disappear.
     
  34. mudloop

    mudloop

    Joined:
    May 3, 2009
    Posts:
    1,107
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    That request got a +3 from me.
     
  36. defjr

    defjr

    Joined:
    Apr 27, 2009
    Posts:
    436
    +3 from me too!
     
  37. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    +3 here.

    Prime31, you were asking for plugin suggestions the other day. I would like to be able to access the page curl up. I believe it is available through the SDK. See the Maps app to see it in action.
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Moonjump, the partial page curl isn't supported on iOS (it's a private API). The full page curl transition is supported but it wouldn't help you with Unity because Unity doesn't use view controllers for handling the game view. Hopefully, the feature request will get them to use a view controller wrapper.
     
  39. nada

    nada

    Joined:
    Sep 30, 2010
    Posts:
    20
    for the isEmailAvailable method: i only realized with your post that i can grab updated versions of etc. my one was an old version where it was not yet available.
    with the newly grabbed version, i do no more experience any crashes with any behaviour of the mail composer!
    thank you very much + grx
     
  40. dcp468

    dcp468

    Joined:
    Aug 25, 2009
    Posts:
    129
  41. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Does the antialiasing use discard as justin meiners shows how in his pdf and does it work on 3g?
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @hippocoder, I don't know who Justin Meiners is and I'm not 100% sure if it works on the 3G. My oldest device is an iPod touch 2G and it works on there. Anyone with the plugin test on a 3G?
     
  43. akurdas

    akurdas

    Joined:
    Jun 20, 2010
    Posts:
    99
    I just purchased Etcetera package from your web page. Unfortunately, while Building from XCode, I'm getting 7926 errors and more than 60 warnings. I'm also using openfeint plugin, but I don't think that's the problem. I'm building for base SDK 4.2 and target device 3.2.
    Any ideas?
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @akurdas, rename the OpenFeint PostprocessBuildplayer to PostprocessBuildplayer_OpenFeint then import the Etcetera Plugin and it should work for you.
     
  45. akurdas

    akurdas

    Joined:
    Jun 20, 2010
    Posts:
    99
    Ok thanks a lot. I just managed to built without Openfeint, now I'll try again. MSAA is amazing totally changed the quality of the game. Great package thanks again.
     
  46. xcodeusa

    xcodeusa

    Joined:
    Jun 27, 2009
    Posts:
    26
    We're using your plugin, it's totally awesome. Ran into a couple problems though. When we use the rate this app feature, whenever the user selects "Do not ask again" the game will prompt the user to review the game again after the game launches x amount of times.

    EDIT: Found the bug in the alertView function of the EtceteraManager.mm in the case 2 switch statement change

    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kRTANextTimeToAsk];

    to

    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kRTADontAskAgain];
     
    Last edited: Dec 2, 2010
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @xcodeusa, good find! The package is updated and an email will be going out in a few minutes.
     
  48. xcodeusa

    xcodeusa

    Joined:
    Jun 27, 2009
    Posts:
    26
    np, question though, I've been reading through this topic and heard about how you've been fighting against autorotation. I was wondering if there's a way to control the orientation of the view on initialize. So right now when I start up webview it will initialize in portrait. Is there a way to initialize in landscape or upside down? Any input would help tremendously.
     
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @xcodeuse, have you tried setting the orientation of the iPhoneKeyboard before pushing the webView? That will usually do the trick.
     
  50. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Hi,
    I'm using your plug-in for a rate/review... I was wondering what happens if an app gets an update? Will the rating plugin status reset and ask for a review again or not? (how?)

    Thank you