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
    @iguana, it sounds like the AR code you are using isn't using the OpenGL context to display it's content. The plugin will only grab the pixels from the current context. It has no knowledge of any other windows, views, screens or contexts.
     
  2. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Hi Prime31,
    i think you're rite about it...i have to find another way...

    I used nativetoolkit to go in and out the unity3d view...but the actual AR its in the unity3d view with a plug in for AR..

    Anyway i used Application.CaptureScreenshot and its working on the desktop, i think its working alos on iOS but i can't find a way to open the screenshot.png file on the iPhone.

    Just a small last question:
    If i use etcetera to take a screenshot (not the mail) how can i have access to the screenshot? I was thinking something like a button to open the image...

    Its a pretty serious thing for me because my client needs it for next tuesday...i'm in panic..:)

    thank you Prime31...great products and hyperfast help! :)
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana, there is an event you can listen to which will tell you the full path or you can just grab it yourself out of the Documents folder.
     
  4. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    @prime31

    I think i found the solution:
    i found that if i use the Application.CaptureScreenshot on my button it captures the entire unity3d view with camera, character and GUI.
    if i use the email with attachment in the etcetera plug in i think it will work.

    Thank you anyway, you are great!

    EDIT:
    I dont know why....but using emailwithattachment is not working...nothing happens..no errors no email composer ....
     
    Last edited: May 15, 2011
  5. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    Please, i have problem implement texture from file function into my javascript. Especially EceteraTextureFailedDelegate errorDel handling part is horror for me. Can anybody help?

    public static IEnumerator textureFromFileAtPath( string filePath, EceteraTextureDelegate del, EceteraTextureFailedDelegate errorDel )

    Somebody used this Etecera function in javascript?
     
  6. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    @Prime31.
    According to the company that created my AR script seems that its using the OGL window, but when i push the button that contains the etcetera script mailcomposerwithscreenshot seems that the plane containing the videotexture (the camera view) is going on the top of everything only when i push the button, this means that something its interfering with the script from the etcetera plug in...

    I'm really destroyed now after 3 days no stop..don't know what to do...i absolutely need it if...you can help me in anyway...
    any idea how to solve it,
    any change of the code (i will pay obviously)..
    Its so so sad to see that its working well, but the email come up with the wrong image...

    Cheers,
     
  7. DarkJedi

    DarkJedi

    Joined:
    Apr 15, 2009
    Posts:
    48
    Hi @Prime31 - going forward can we possibly have DontDestroyOnLoad(this); added to EtceteraManager.Awake - this is already in SocialNetworkingManager and GameCenterManager. (if only for my own stupidity for taking so long to realise why EtceteraManager fell by the wayside when its brothers soldiered on! ;))

    Also, a "nice to have" would be a wrapper around NSLog in the etcetera plugin, so that we can poke messages into the XCode console whilst debugging.

    Cheers,
    Dan
     
  8. DarkJedi

    DarkJedi

    Joined:
    Apr 15, 2009
    Posts:
    48
    Hi Prime31 - found a typo in AppControllerPushAdditions.m:

    Method didFailToRegisterForRemoteNotificationsWithError is using incorrect UnitySendMessage parameters. It should be using:
    Code (csharp):
    1. UnitySendMessage( "EtceteraManager", "[COLOR="red"]remoteRegistrationDidFail[/COLOR]", [[error localizedDescription] UTF8String] );
    Regards,
    Dan
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana, out of curiosity when you use Application.captureSceenShot (not 100% sure that is the correct method name) what do you see?

    @Dan, Debug.Log will end up dumping to the Xcode console from Unity. Will take care of adding DontDestroyOnLoad and fix the typo today.
     
  10. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    @prime31
    I see the video on the background, the graphics and gui....its perfect...but i don't know how to use it...how to add it to your emailcomposer...

    Would be fantastic if i could use your emailcomposer with screenshot...:(

    I tried to use your email composer with attachmente and use the png generated by Application.CaptureScreenShot but nothing happens...:(

    EDIT: Just to show you what i'm doing so maybe you can notice something wrong and correct me.
    This is the code using Application.CaptureScreenshot and etcetera email composer with attachment.

    Application.CaptureScreenshot("Screenshot.png");
    EtceteraBinding.showMailComposerWithAttachment( "basedir/Documents/Screenshot.png", "image/png", "Screenshot.png","test@test.com","Title","Body", false );


    when i click nothing happens but if i open the documents folder form Xcode i see the screenshot into the documents folder...
     
    Last edited: May 16, 2011
  11. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31

    Hey quick question. Is there any sorta callback or notification for when a webpage is finished loading when using showWebpage? currently i have a bug in my current game thats requiring me to show a loading screen while the page is loading and then show the page once its done. I could cheat and put a timer in there based on some webpage access average but.. probably not a good idea.

    Cheers
    Bryan
     
    Last edited: May 16, 2011
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana_02, the method signature from the documentation has all the information you need:

    // Opens the mail composer with the given attachment. The attachment data must be stored in a file on disk.
    public static void showMailComposerWithAttachment( string filePathToAttachment, string attachmentMimeType, string attachmentFilename string toAddress, string subject, string body, bool isHTML )

    You can't just send png data. The proper thing to send as the method signature shows is the filePathToAttachment.
     
  13. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Sorry Prime31....but i'm not that expert....:)
    Do you mean i can't use a png as an attachment?
    Sorry but i didn't understand exactly what do you mean or where i'm doing wrong...

    For example..."The attachment data must be stored in a file on disk" i thought that the png is a file stored on the documents folder...
    on the iphone.

    anyway...just to ask...
    if i can't use a png as an attachment, is it that difficult to use mailcComposerWithScreenshot but using the screenshot (made by application.CaptureScreenshot) stored in the documents folder of my app?
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana_02, you can attach any file type that you want. Just pass the full path to the file as the first parameter. The proper flow would be:

    - grab screenshot with application.CaptureScreenshot
    - write to disk
    - call showMailComposerWithAttachment with the path to the file you just saved
     
  15. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    @Prime31...thank you for your patience...you are an incredible guy..

    I think the main problem here is that the showMailComposerWithAttachment is not working..its not coming up...
    i tried showMailComposerWithScreenshot and it works (with the wrong screenshot)
    and showMailComposerWithAttachment simply doesn't come up..its not showhing....

    i'm using:
    EtceteraBinding.showMailComposerWithAttachment( "Documents/", "image/png", "Screenshot","test@test.com","Title","Body ", false );
    would be fantastic if you tell me what i'm doing wrong and then i'll buy you some champagne! :)
     
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana_02, all you are passing to the method as the filePathToAttachment parameter is "Documents/". There is no such file as "Documents/". If you cant find the file with the standard Mono System.File.Exists() call than your path is incorrect. You need to pass the full path to the file you want to attach.
     
  17. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    ok, definitly i'm doing wrong...i simply don't get it due to my lack of programming...

    i thought was a path to the file, that's why i put "documents" because the files is inside the documents folder...

    thank you anyway, you helped me a lot now i have to find a way to understand how to find the right path.
     
  18. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31

    Heya prime... i think i got lost in the thread so i'm gonna bump this.. :)

    Hey quick question. Is there any sorta callback or notification for when a webpage is finished loading when using showWebpage? currently i have a bug in my current game thats requiring me to show a loading screen while the page is loading and then show the page once its done. I could cheat and put a timer in there based on some webpage access average but.. probably not a good idea.

    Cheers
    Bryan
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, there is no page loaded callback for the webview.
     
  20. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31 - thanks prime!
     
  21. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Hi Guys,
    After another night with no sleep at all (tomorrow i have to show the app to the client)...i decided to ask this last question (i know i asked a lot this week and i'm deeply sorry but believe me i tried everywhere and everything).

    Can please someone that got the emailcomposerwithattachment fully working and running post an example script...so i can see how an absolute string path should look like, for example, i got an app, inside the app a Documents folder inside the folder a file called Screenshot.png., this means i need the path to this file, i'm not a coder or an expert so i thought should be something like: App Name.App/Documents/Screenshot.png and i tried other 1000 ways, but its not working...so please....
    If someone got his code working would be cool if you can post it in here, just to see the structure of this bloody path...:)

    Thank you in advance.
    Iguana_02
     
  22. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,816
    Hey iguana,
    I replied to you but maybe it didn't get through... Try this. The yield bits are a little hacky, sorry...

    import System.IO; // at the first line of .js script.

    //Take a screenshot -
    EtceteraBinding.takeScreenShot("SnapShot.png");

    //Get Path
    var DocumentsPath : String = Application.persistentDataPath;

    //Delete the custom image if ther is one in the path already
    if (File.Exists(DocumentsPath+"/ScreenCap.png")){
    File.Delete(DocumentsPath+"/ScreenCap.png");
    print ("File Deleted");
    }

    yield WaitForSeconds(1);//just in case it takes it takes a sec to delete any existing screencapture

    //Take a screenshot
    EtceteraBinding.takeScreenShot("ScreenCap.png");

    yield WaitForSeconds(1);//just in case it takes it takes a sec to save the screencapture
    print ("This is your Documents Path ---> "+DocumentsPath);

    EtceteraBinding.showMailComposerWithAttachment(DocumentsPath+"/ScreenCap.png","png","ScreenCap.png","email@mail.com","Subject!","Body!",false);
     
    Last edited: May 17, 2011
  23. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    That great! Now its working perfectly!!!!!! Thumbs up for Petey! And obviously for Prime31's etcetera plug in!!!
     
  24. crazie.coder

    crazie.coder

    Joined:
    Mar 8, 2011
    Posts:
    5
    Hello,
    I read the whole thread read about iTunes Link Maker, but still am not able to figure out how to create a link for my app. We already have 6 games released, I do get a artsit link, but I want the link directly to my app`s review page. How can I do it?
     
  25. crazie.coder

    crazie.coder

    Joined:
    Mar 8, 2011
    Posts:
    5
    Hello, I am using askForReview, How do I get the "iTunesUrl" for my app
    I read the whole thread read about iTunes Link Maker, but still am not able to figure out how to create a link for my app. We already have 6 games released, I do get a artist link, but I want the link directly to my app`s review page. How can I do it?
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @crazie, check the documentation. There is a link on there that will show you how to make the proper links.
     
  27. crazie.coder

    crazie.coder

    Joined:
    Mar 8, 2011
    Posts:
    5
    I tried iTiunes Link Maker. But it shows link upto my company name (Artist Page). To go to app directly I need the app ID. Am I correct here? If not How do I get the app id before the app is released.
     
  28. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Hi Prime, i just downloaded the UIToolik and its fantastic! I absolutely need it to have both SD and HD GUI.
    I had to do the script in C (instead of Javascript) and i got one small problem that after 2 days i didn't manage to solve.

    Seems like Application.CaptureScreenshot its saving the PNG the file but the mailcomposerwithattachment starts before has been saved into documents.
    I tried to ass a StartCoroutine to give it time to save but it doesn't work.
    I javascript was working but not in C.

    I tried many times in many ways but i don't receive any error...its simply not working.
    If i exclude the "If delete" part the mailcomposer comes up with the previous screenshot.

    Please can you can tell me where i am doing wrong (if you have time obviously) ?
    Thank you!

    }

    public void onTouchUpInsidePictureButton( UIButton sender ){

    //Get Path
    var DocumentsPath = (Application.persistentDataPath);
    EtceteraBinding.showBezelActivityViewWithLabel( "Saving Image..." );
    //Delete the custom image if ther is one in the path already
    if (File.Exists(DocumentsPath+"/Screenshot.png"))
    {
    File.Delete(DocumentsPath+"/Screenshot.png");
    //Take a screenshot
    StartCoroutine( pauseActivity() );
    Application.CaptureScreenshot("Screenshot.png");

    }
    // hide the activity view after a short delay
    EtceteraBinding.saveImageToPhotoAlbum( (DocumentsPath+"/Screenshot.png") );
    StartCoroutine( hideActivityView() );


    //Open MailComposer
    EtceteraBinding.showMailComposerWithAttachment(DocumentsPath+"/Screenshot.png","png","Screenshot.png","","XXXX App","I downloaded this amazing App from iTunes!",false);
    }
     
  29. DarkJedi

    DarkJedi

    Joined:
    Apr 15, 2009
    Posts:
    48
    @iguana_02 - check out EtceteraBinding.showMailComposerWithScreenshot which might simplify things for you :)
     
  30. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Hi DarkJedi, I know it would be fantastic the main problem is that the screenshot that comes from it its without the 3d augmented reality i see from the camera, it shows only the view from the iPhone 4 camera.
    Application.CaptureScreenshot works and shows everything.

    Last week i manage to make it work in Javascript (Thanks to Petey) but now that i'm using UIToolik (and i love it) i need the C version.
    Its almost working the only problem is that Application.CaptureScreenshot its saving the image but the mailcomposer start before has been saved.
     
  31. DarkJedi

    DarkJedi

    Joined:
    Apr 15, 2009
    Posts:
    48
    Ah right, I see - you're having to use the Unity screenshot function rather than the EtceteraBinding one...

    Yeah it can take a few seconds for a screen grab to save to the file system. (You might want to resize the resultant image as well?)

    Well, you need to introduce a delay...and therefore either turn onTouchUpInsidePictureButton to IEnumerator co-routine and have a yield return new WaitForSeconds(2f) to pause for a couple of seconds before triggering the mail composer, or to move the mail composer code to its own routine and call it with an Invoke and a couple of seconds to delay it enough...

    Neither is ideal - I don't like pausing for an arbitrary amount of time here - perhaps someone will chip in with a more robust workaround :)
     
  32. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    You're the man! I created a IEnumerator with a yield and the mail in it
    and in the void start i added the coroutine...and now it works..:)

    thank you!
     
    Last edited: May 25, 2011
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana, Unity 3.4 (which is in beta and will be released really soon) has finally fixed the Application.CaptureScreenshot bugs so I have already made an internal build of the Etcetera Plugin that uses it. It also has a helper method that allows Application.CaptureScreenshot to be wrapped up in a coroutine for easy access.
     
  34. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Prime, that's sound great!! :)
     
  35. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Hi guys,
    probably this is the most noob question you've ever heard...

    I'm using the webview from etcetera plug in and it works fantastic, now that i solved the "path problem" i'm sure it will work also reading local html....but...

    My question is...How the hell can i copy local files into the Apps documents folder on my iDevice?

    Application.CaptureScreenShot does create it in an automatic way...but what about if i have pre-existing files and i want to copy it straight to the iDevice?

    PS: Prime...UIToolkit its the best thing i ever see in my life...one gui...4 different iDevices...no problems...thanksss!!!!
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana, you cam copy anything you want into the Documents directory using the standard System.IO.File methods. Glad to hear you are liking UItoolkit by the way!
     
  37. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Thank you Prime, i did it! :)
     
  38. hxx2010

    hxx2010

    Joined:
    Aug 31, 2009
    Posts:
    155
    Why the abolition of the current version of enableAntiAliasing function, I checked the EtceteraBinding script file, find that you have written off this feature, what does this function do bad
     
  39. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @hxx2010, MSAA is available directly in Unity now.
     
  40. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    Hi Prime, just a quick question:
    I also bought etcetera 2 because i needed the video OUT, but after i added the plug in on my unity3d project, Xcode now reports me 2 building errors with no explaination....i checked the postprocessing builder and its fine...
    is etcetera2 compatibile with etcetera 1 and nativetoolkit in the same project?

    Cheers,
    Ale.
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iguana, it's a real simple fix: open EtceteraManager.mm and search for ColorFromHex. Replace all occurrences of ColorFromHex with anything else (like ColorFromHexOne). I'll push out an update also as soon as Ubity 3.4 drops (real soon).
     
  42. iguana_02

    iguana_02

    Joined:
    Apr 22, 2011
    Posts:
    211
    thank you prime! it works perfectly now.
     
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    An update to the EtceteraTwo Plugin went out earlier today with some new piracy detection methods. Enjoy!
     
    Last edited: Jul 13, 2011
  44. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    Hi Prime,

    I just had to install the unity 3.4beta yesterday (unfortunate at this state of my game), thus had to fix many errors in my scripts. Now I'm stucked with 4 errors in the AppController that seem to be related to the etcetera 1 plugin. The errors are all the same: ../xcode/Classes/AppController.mm:594: error: 'CreateSurfaceMultisampleBuffers' was not declared in this scope.

    I can't build at the moment and I would really like to avoid downgrading. Anything to fix this is very much appreciated?

    Thank you!
     
  45. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @synapse, we'll have an update when 3.4 goes live. Until then, rename the .patch file to .txt and delete any references from the *Binding.m file to the take screenshot method.
     
  46. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    Great, thanks! Fastest response ever btw! :)

    EDIT: Yes, it worked. Thanks!
     
    Last edited: Jun 11, 2011
  47. ssmchan

    ssmchan

    Joined:
    Nov 6, 2010
    Posts:
    72
    Dear Prime,

    Would you make the Web plugin and it can embedded in Unity3D? I have bought the Etcetera Plugin but the web plugin is call the external "Web Page". We would like to build an application and the screen will have Web page display on top and bottom have some buttons ( Unity3D button ) can change the link for control show difference web page content ( Links ).

    Thanks so much!

    Regards,
    Simon.
     
  48. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Simon, that is a very specific use case. If you are skilled in Objective-C you can use our free NativeToolkit Plugin (available on the Asset Store) to pull that off.
     
  49. ssmchan

    ssmchan

    Joined:
    Nov 6, 2010
    Posts:
    72
    Dear Prime,

    Got it, thanks! I will try it but if you can enhanced the Web Plugin later and we will more easy to using it. :)

    Regards,
    Simon
     
  50. gemito138

    gemito138

    Joined:
    May 25, 2011
    Posts:
    2
    Hi today I buy etcetera plugin. I'm very happy with this and I think that worth every dolar... i need a little help, i want to capture a value from a "EtceteraManager.twoFieldPromptTextEntered" but I don't know how to do this. My skills are very limited... :) How i can assign the value to a variable? I read the post in the number 9 page but ...
    I can capture both values and then show in a Gui.Label
    Many thanks in advanced.
     
    Last edited: Jun 16, 2011