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

[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
    @sfilo,

    1. if you have the skills to do that of course it will work
    2. yes, Flurry tracks while offline
     
  2. StoneFish

    StoneFish

    Joined:
    Aug 26, 2012
    Posts:
    123
    Hi
    I know I'm probably posting something very elementary, but with the limited documentation and difficulty searching through 48 pages of feedback, I thought i'd ask!!

    I have an alertMessage firing at an event, that contains two buttons, yes and no.

    I'm struggling to figure how to cancel the alert if the user selects no.

    Looking at documents, I figured it's something like:

    Code (csharp):
    1.  
    2. EtceteraManager.alertButtonClicked += AlertCallbackCancel;
    3.  
    4. function AlertCallbackCancel(alertText)
    5. {
    6.      if (alertText == no) //no
    7.     {
    8.             EtceteraManager.promptCancelled;
    9.     }
    10.    
    11.     else
    12.     {
    13.         //Yes button selected??
    14.        
    15.     }
    16. }
    17.  
    18.  
    ....however with the above I receive an error "'EtceteraManager.promptCancelled' cannot be used as an expression." So obviously, I'm going about this the wrong way.

    Would appreciate help from anyone! Thanks!
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @stone, you can't cancel an alert. Only a user can do so by touching one of the buttons.
     
  4. iRetrograde

    iRetrograde

    Joined:
    Oct 13, 2011
    Posts:
    93
    Hey Prime,

    How's it going?

    Just have a question between the functionality of the iOS Etcetera plugin with the Android plugin and noticed that there is no urbanArishipGetAPID() call in the iOS plugin (at least in the documentation of the site). Can you confirm how we can get user's UA APIDs for iOS?

    I'm taking a look at various documentation and looking at this, it seems like the UA functionality simply gets you to register an "alias" to the device which then I'd have to register said alias and treat it like an APID?

    Anyways, I'm gonna get in touch with the guys at UA to get more knowledge on how to structure this properly, but if you could let me know if this is the right track, that would be great.

    Cheers!
     
    Last edited: Nov 22, 2012
  5. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iretro, UA has a REST API that you can use to access anything they offer.
     
  6. iRetrograde

    iRetrograde

    Joined:
    Oct 13, 2011
    Posts:
    93
    Hey Prime, just noticed that from in here (C# example of building a JSON packet and sending to their REST API):

    http://weblogs.thinktecture.com/cwe...messages-to-urban-airship-service-with-c.html

    I was asking more about what I would need to functionally have everything working together. It seems like the answer that I was looking for was that the JSON packet that you send to their REST API can take both "aliases" which are used by the iOS UA plugin and "APIDs" which are used by the Android UA plugin. Allowing me to message both Android and iOS users seamlessly.

    Thanks for your time!
     
  7. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    can we cut the image into two?
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jeroenx, you can do whatever you want with the image. It is just a normal png.
     
  9. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    so after taking a picture in the game The Dictator, they are able to move, scale and rotate the photo. Is that included in the plug in?
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jeroenx, the plugin gets you the screenshot. You have to edit the texture yourself. View our documentation (http://prime31.com/unity/docs) for the full API.
     
  11. sfilo

    sfilo

    Joined:
    Oct 23, 2012
    Posts:
    28
    Hi Prime,
    I'm still trying to decide wether to use the etcetera plugin for a cross promotion module for my apps. I would love to be able to use it since you've done most of the heavy lifting but there are a few thing I have to be sure I can do.

    1. Looking at the EtceteraBinding.cs exposed methods I cannot find a way to show a custom view controller. Is this possible? If not how easy do you think it would be for someone with basic cocoa touch knowledge to implement it on top of your code ( maybe copy the ShowWebPage functionality )?
    2. Do you have plans to support SKStoreProductViewController the way you integrated the email composer? Or do you think it would be relatively easy to implement?
     
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sfile,
    1. It is not part of the plugin and using Etcetera would not help in implementing custom view controllers.
    2. We have no plans to support SDKStoreProductViewController at this time. If you are skilled in Obj-C it isn't difficult to implement.
     
  13. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    hello prime31,

    I am having an error building on xcode 4.5.2, unity 3.5.6f4 (trial)
    tried all the 3 armv builds.

    Undefined symbols for architecture armv7:
    "__etceteraIsSMSAvailable", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__etceteraUniqueDeviceIdentifier", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__etceteraPromptForPhoto", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "__etceteraShowPromptWithOneField", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    ....
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I think I have the same issues on the first page
     
    Last edited: Nov 27, 2012
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
  15. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    Hi Prim31,

    Is it possible to attach multiple files in one email session? I know that we can attach one file/email.

    Thanks
     
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @duff, only one file can be attached.
     
  17. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    So I have 2 audio files and 2 images that I wanted to attach and send email to multiple people.

    I am saving those files inside documents folder of iPhone. So I could be sending them as an local HTML link content inside body?

    Thanks for quick reply.
     
  18. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    Hi Prime31,

    In short can you show an example of how you would put image src to get an image inside iphone document folder?
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @druffzy, the normal Unity StreamingAssets folder will work for that. It just copies the files over unmodified into your app bundle. You cant send them as an HTML link. That doesn't make any sense. A link has to be available on the web. You can attache the file though.
     
  20. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    @Prime31, the reason i want to display local images and not the web one is because the app is going to be used by lots of users. And if content is getting uploaded online then there will be lots of ambiguity and confusion amongst users and they might not see the right output.

    therefore I thought either just do it as attachments or put the contents in the body. So if its possible for me to put file:///iphonedocumentpath()+filename in either a href or img src. that would be great. Can you show me simple example on how you would write html inside body including a href?
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @druffzy, you cannot link to files contained in your app bundle. It isn't possible on iOS.
     
  22. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    Thanks prime31. Appreciate it.
     
  23. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    is takescreenshot working with xcode 4.2?
    after taking a screenshot, how can I save it successfully?
    in what folder will it go?
     
    Last edited: Dec 3, 2012
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jeroenx, it is just a wrapper for Application.CaptureScreenshot now and it writes to the only writable directory available on iOS: Documents.
     
  25. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    what happenned with push notification? i've just upgraded to the latest version of the etcetera plugin for android and urbanairship is gone :?
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @creat, you already posted this same question in the relevant Android forum. Please do not SPAM multiple forum topics and do not post Android questions in the iOS forum.
     
  27. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    Hi Prime31,

    One more question.

    For EtceteraBinding.showMailComposer I am writing some basic HTML. part of which is dynamic. For eg

    <img src='/directoryName/ss.png'> the directoryName changes everytime user opens the app. So how do I cascade the dynamic directoryName into path?

    static paths work fine. I tried body as "<img src= /"+directoryName+"/ss.png"> but that doesnt work. any thoughts?

    Thanks
    Dhruv
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @druff, if you want to use img tags you need to host the images on an external web server.
     
  29. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    @prime31, yes I am doing that
    srry for that bad example
    here is the actual value
    body = "<img src= 'http://example.com/"+uniqueUserId+"/screenshot.png' >";

    uniqueuserID is something that changes.
     
  30. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @deuffzy, as long as your html string is valid nothing else needs to be done. Sounds like you need to do some debugging to ensure you are passing valid HTML.
     
  31. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    @prime31, so I just want to confirm dynamic path is something that works right? i tested static paths and it works fine.
     
  32. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @druffy, the path isnt dynamic to the mail browser. It accepts only a string of HTML.
     
  33. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    Thanks prime31. Found the mistake!
     
  34. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    I finally got so upset about the volume of blank email in Paint My Cat that I debugged this. It affects iOS5 iPads only. The reason it only affects iPads is that in showViewControllerModallyInWrapper(), the modalPresentationStyle gets changed on iPad.

    It seemed like a lot less hassle to comment out the line and use the default modalPresentationStyle (which effectively, means your form popup fills the full height of the iPad and doesn't leave pixels top and bottom) than to do anything else about it.

    Alex
     
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @ferret, that is a known issue that affects only specific iOS versions. We have reported it to Apple a while ago as have a couple of our plugin users.
     
  36. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    Yes sorry, perhaps I wasn't clear. We spoke a while back and I knew you'd reported it.

    I was just saying to other developers "if a decent percentage of your users are using iOS5 on iPads, and you're getting lots of blank feedback and you want a fix right now this minute, here is a way."
     
  37. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    Hello Prime31,

    How should I handle the takeScreenShot and then saveImageToPhotoAlbum.
    I tried

    if (hit.collider.gameObject.name == "ScreenShot"){
    StartCoroutine( EtceteraBinding.takeScreenShot( "someScreenshot.png" ) );
    StartCoroutine( EtceteraBinding.saveImageToPhotoAlbum(Application.persistentDataPath));
    }

    I know I am missing something.. the imagePath

    Thanks.
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jeroenx, not like that. You arent giving the screenshot time to finish. Do you know how to use coroutines? If you do not I suggest you check Unity's manual or look at the showMailComposerWithScreenshot for an example of how to properly wait for the screenshot to complete and then use it.
     
  39. jeroenx000

    jeroenx000

    Joined:
    Oct 4, 2012
    Posts:
    27
    what does this error mean?

    You are trying to load data from a www stream which had the following error when downloading.
    <url> malformed
    UnityEngine.WWW:get_texture()
    <textureFromFileAtPath>c__Iterator2:MoveNext() (at Assets/Plugins/Etcetera/EtceteraManager.cs:106)
     
  40. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    I just downloaded the latest Etcetera update (2012-12-26) and imported the package into an existing project (already using Etcetera). Then, in Unity, it told me there was another update, so I installed that. Now the project won't build in Xcode. I get the following errors (after cleaning). This is in Unity 3.5.7f6. Target platform is arm7, iPad only.

     
    Last edited: Jan 2, 2013
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jeroennx, the error pretty clearly states the URL is malformed.


    @john, read the troubleshooting section of the docs (http://prime31.com/docs)
     
  42. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    Could you please be a little more specific? I see nothing on that page that addresses the problem I'm seeing.

    This is a project I just updated from Etcetera_2012-09-14. It was working before. It is and was set to arm7 in the Player settings. I imported the new Etcetera package, then deleted the manager prefab from the scene as it said, then installed an update within Unity, as it said to do. I deleted the previous Xcode project, did a build in Unity, then opened in Xcode 4.5.2. I get 37 errors. I did a clean in Xcode, and still get 37 errors. I am NOT getting the usual Finder notification that I've gotten in the past with a new build.

    I don't see any errors in the logs.

    Unity Console output:
    Console app:
     
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @john, the log seems to indicate you have old files mixed in with new. Delete all old files then reimport the plugin.
     
  44. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    Thanks, that did the trick. Will save a lot of time when I update my other apps.

    My main reason for updating is to try out the inline web view. I have a few questions about that.

    How do you specify a local URL. I have the HTML files in my Resources folder inside the Assets folder. What URL do I use for those files? I've tried /Resources/file.html, Resources/file.html, file.html, and all of them give me a blank web view. URLs for non-local pages work fine.

    Is there any way to communicate between the web view and Unity? For example, could I have a button on the web page that would close the web view or resize it?

    Is there any reason I couldn't draw a GUI frame around the web view? It looks a little odd without a title bar. I'd also like to be able to drag the web view around to change its position. With a draggable sprite I could update the web view frame location as the sprite is dragged. Any reason why that wouldn't work? I haven't tried yet as it is such a slow process to build and run every time, and I'm waiting to see if I can get local files to work first.

    Thanks.
     
  45. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @john, the local URL must be a plain, old, standard file path. You should check it with the standard File.Exists to ensure it is correct. Resources folder will absolutely not work because it is not a real folder. Everything in Resources is packaged up by Unity into a single binary file. StreamingAssets is the folder to use in Unity. Refer to Unity's docs to learn how it works.

    There is no communication between the web view and Unity available besides changing urls. You can do whatever you want with the web view from the Unity side. It's only restrictions are the API it exposes.
     
  46. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    One more question:

    If I create an in-line WebView that is smaller than the screen, it looks like it takes a full-screen WebView and shrinks it down. For example, I created an in-line WebView that is 512 pixels wide (half the iPad landscape width). On the web page, I made a table that is 500 pixels wide, so it should just fit in that Web View. All text and graphics on the page are in that table. But instead, the table occupies only half the width of the WebView, and everything is very tiny and almost illegible.

    Is there any way to have an in-line WebView that is not just a shrunken version of the full-screen? Otherwise, with everything being so little, it's not really usable. The only non-optimal solution I can think of right now would be to make everything on the web page, text and graphics, double size. Which would sort of defeat the purpose of reusing existing pages.
     
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @john, adjust your css to fill the full screen. It is outside of the scope of the plugin how to properly code an HTML/CSS page for mobile. Apple's docs are excellent and you should read and understand how the viewport, scaling and other features of UIWebView work.
     
  48. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    Thanks. I wasn't sure if it was something about the way the WebView was scaled. Got it working now.

    One thing I noticed is that sometimes the page stops scrolling correctly. It responds to touch, but stops scrolling as soon as the touch ends, no continued scrolling or rubber band effect at the top and bottom. The page sometimes just stops with the top or bottom part of the view blank and the page stuck in the middle. When this happens, links on the page do not work. If I continue trying to scroll, it does the jerky/sticky scrolling for a while then eventually starts scrolling normally and links work again. This seems to happen at random, sometimes scrolling normally and sometimes not.

    So far, I've just tried this with simple, text-only pages and nothing else going on in the app at the time the WebView is showing. I don't see any obvious drop in the frame rate when scrolling isn't working.
     
  49. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    One other problem I've noticed with the inline WebView. This function does not work as described.

    Rather than just setting a new frame rect, it it does an animated transition to that new rect.

    In order to hide the WebView without closing it, I've tried moving it offscreen along with the frame sprite I have drawn around it. The frame jumps as it should to its offscreen location, but the WebView translates to that new position. So the frame disappears, but the WebView slides off screen. Same thing when I show it, the frame appears and then the WebView slides into it.

    Is there any way to change the position of the WebView without the animated transition? Or a way to control the speed of the translation? Or alternatively, any way to hide the WebView without losing its current contents?

    And I'm still seeing the occasional freezes in the WebView scrolling.
     
    Last edited: Jan 3, 2013
  50. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    I've spent quite some time trying to integrate the SetFrame animation with my interface, and I've concluded it's not possible. I can get close, but never precisely sync the animation with my 2D interface animation.