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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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
    @john, just open the EtceteraManager file and comment out the animations in the inlineWebViewSetFrame method if you don't want them there.
     
  2. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,253
    Thanks.

    However, sometimes I want to use the animation. For example, when dragging the WebView around, it makes it much smoother. So I made the animation optional by adding a boolean input to the inlineWebViewSetFrame method. To do this, I had to change the following files:

    EtceteraBinding.m
    EtceteraManager.h
    EtceteraManager.mm
    EtceteraBinding.cs
    EtceteraGUIManagerThree.cs

    So now I can turn the animation on or off as appropriate. I'd be happy to share my code changes if you'd like to incorporate this option into a future update.
     
  3. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,253
    The scrolling/freezing problem in the inline WebView is very consistent, happening about half the time at least. The only way to start it working again is to scroll all the way to the top or bottom of the page, which can be difficult when the scrolling doesn't continue after you lift your finger. I'm afraid users will quickly get frustrated when all of the links on a page stop working and they can no longer scroll properly. I don't know if this is an iOS problem or an Etcetera problem (it doesn't happen in the full-screen WebView). I'm thinking the only way I can use an inline WebView is if I put some text on every page telling the user what to do when the scrolling/links stop working. And I'm not too crazy about that idea.

    Is it just me, or can anybody else reproduce this problem?
     
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @john, it is entirely normal for native views to not scroll smoothly when displayed on top of an OpenGL view. OpenGL uses the DisplayLink for timing and native views prefer an event based setup. There is no way to avoid the performance issue besides turning off the DisplayLink in Unitys AppController class but even that won't get you perfect scrolling.
     
  5. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,253
    The scrolling problem I could live with. The non-functional links is a more serious problem.
     
  6. syrdhfhfh

    syrdhfhfh

    Joined:
    Nov 28, 2012
    Posts:
    5
    is it possible to take screen shot by using etcetera for iOS? I used Application.capturescreenshot but it seems not working. and i realize that movie texture is not able to use for iOS platform, is there any other way to play a MP4 movie? thanks for helping
     
  7. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @syrd, the Etcetera Plugin uses Application.CaptureScreenshot as well now.
     
  8. syrdhfhfh

    syrdhfhfh

    Joined:
    Nov 28, 2012
    Posts:
    5
    but it doesn't save the screen shot to camera roll. sorry if i am asking silly question
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @syrd, Taking a screenshot and saving it to the camera roll are two completely different operations. The Etcetera Plugin can save any image to the camera roll.
     
  10. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,253
    I'm seeing the sticky scrolling and non-functional links in the full-screen as well as the inline WebView. It happens in several apps that I've tried now, on an iPad 3 in iOS 6.x and on an iPad 2 in iOS 5.x. If anything, it seems to happen more often on the iPad 3.

    I thought it might have something to do with opening a full-screen WebView when an inline WebView was already open, but that doesn't seem to make a difference. Is there any reason I should close the inline view before opening a full-screen view?

    I also notice that the problem seems to be worse with bigger HTML files. Smaller ones stick, but not nearly as often as bigger files. Could this have something to do with a buffer being too small or not enough memory being devoted to the WebView?

    Is this just me, or is anybody else seeing this problem? For me it's consistent and reproducible across several different apps, a variety of different HTML content, different iPads and different OSs. As I said, the scrolling problem is annoying, but I'm not sure users would know the workaround when everything else on a page stops working.
     
  11. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,253
    The WebView seems to have a cache that I cannot clear. Deleting the app and reinstalling it does not do it. Some web pages that are updated on the server will not refresh in the apps. I have several apps, and it seems like there is one or two pages that won't update in each app. I can't seem to get Safari to refresh a few pages either (not necessarily the same ones), so I don't know if there is some common web cache or the two are related. I know the web pages are updated on the server, since I can see the correct versions in Mobile Safari and on my Mac.
     
  12. Du Burn

    Du Burn

    Joined:
    Jul 24, 2012
    Posts:
    4
    i have a predifine jpg i want to be able to email, and i would like to use showMailComposerWithAttachment could any help me on how to do this, i have no idea
     
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @du, just call the method showMailComposerWithAttachment with all the required parameters. What exactly about that can you not do? There is even an example of it in the demo scene with a screenshot being sent.
     
  14. Du Burn

    Du Burn

    Joined:
    Jul 24, 2012
    Posts:
    4
    this is what im trying

    EtceteraBinding.showMailComposerWithAttachment( "GUI/", "image.png", "Target","trarget@home.com","Title","Body ", false );

    im making a AR App and need to be able to email the target iv picked. i want it to work in a simler way as screengrab, but with a image.


    gui is the folder in my unity project.
     
  15. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @du, what exactly makes you think just passing "GUI/" as the filePathToAttachment would work? First of all, that isn't a path to a file at all. Your file path must be a full valid path to a file on the hard drive of the device. The file path can be validated quite simply by using the built in File.Exists method. The next issue is that you are passing in "image.png" as the attachmentMimeType. "image.png" is not a mime type at all. There are hundreds of mime type lists on the web. The first that came up in Google was http://www.freeformatter.com/mime-types-list.html
     
  16. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    Hey @prime31 Looking at the Urban Airship documentation you can make one device send a push notification to another device. Something like that:

    - Player 1 register on UrbanAirship server
    - Save the player 1 DeviceToken on your server linked to the user
    - When player 2 want, they can send a push notification thru Urban Airship like:
    - Player 2 poke Player 1

    There is a way of doing that by Etecetera Plugin?! Or maybe I'm missing something and this king of thing must be done by server side?
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @badawe, you can either just use UAs REST API (not recommended as it requires your secret to be in your app) or use a proper web server.
     
  18. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    Sorry about this, but, what is UAs REST API?!
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @badwe, Urban Airships REST API. Go to their webpage and look it up.
     
  20. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297

    Great Thanks! =D

    one last thing, i can't found where i can get the device token? To save in our server?

    Its something like that?
    Code (csharp):
    1.  
    2. // Returns a unique identifier for the current device and application
    3. public static string uniqueDeviceIdentifier()
    4.  
    5. // Returns a unique identifier for the current device
    6. public static string uniqueGlobalDeviceIdentifier()
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @badawe, the remoteRegistrationSucceeded event fires with the device token when a user allows push notifications via the popup dialog.
     
  22. Du Burn

    Du Burn

    Joined:
    Jul 24, 2012
    Posts:
    4
    Could anyone post some working code, i have no clue on how to get this to work. i need it to work on a iOS thanks for any help


    prime 31 - showMailComposerWithAttachment
     
  23. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @da, see the included demo scene for an example.
     
  24. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi,

    I've bought Prime 31 Etcetera plugin, and added it to a lite version of our app. I submitted the app and the upload went well but i got an email apple from stating the following:
    Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement.

    Now i used the same code as the normal version of our app and added Prime31 Etcetera for IOS in the lite version to use a native popup which links to the app store. So it seems the Etcetera IOS Kit is doing this? Any thoughts?

    EDIT:
    I also checked the App id on the apple developer site and Push Notifications are turned off.

    EDIT 2:
    I think it has something to do with updating Xcode to 4.6 because i now get the email with every app i submit and i submitted 2 today...
     
    Last edited: Feb 6, 2013
  25. badawe

    badawe

    Joined:
    Jan 17, 2011
    Posts:
    297
    Humm ok, maybe i got it, but I still have problems.

    Here is the thing:

    1 - Generated my push credentials at apple store (Development and Distribution)
    2 - Created a account on Urban Airship
    3 - Uploaded the Credentials on UA
    4 - Setting up my credentials on EtceteraTestSceneTow
    5 - Compiling the EtceteraTestSceneTwo on my device, using my bundle id
    6 - Run on device.


    Here is what I'm getting:

    When i press on Set Urban Airship Credentials:
    Code (csharp):
    1. Nothing on xcode debug
    When i press the Get Registered Push Types
    Code (csharp):
    1. Nothing on xcode debug
    When i press the Register for Push
    Code (csharp):
    1. remoteRegistrationDidFail: Error Domain=NSCocoaErrorDomain Code=3000 "nenhum código de autorização válido de 'aps-environment' foi encontrado para o aplicativo" UserInfo=0xcdd5350 {NSLocalizedDescription=nenhum código de autorização válido de 'aps-environment' foi encontrado para o aplicativo}
    2. //English: no valid code of authorization of  'aps-environment' was found for this app
    3. remoteRegistrationFailed : nenhum código de autorização válido de 'aps-environment' foi encontrado para o aplicativo

    I'm doing anything wrong?
     
    Last edited: Feb 6, 2013
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @badawe, your provisioning profile/app is not properly setup in iTunes Connect. Apple is saying you do not properly have the push entitlement in it.
     
  27. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,253
    I just submitted several apps to the iTunes Store, and they all generated this message:

    I did nothing to register for push notification and don't need that feature, so the only thing I can think of is that Etcetera might be doing this. Is that the case? If so, do I need to disable something and resubmit my apps? Or is this something I can just ignore?
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
  29. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,253
    Thanks. If I understand correctly, this is just a problem with the code analyzer and not the code? So, leaving the files in will not affect the app, just prevent the warning message? I'm asking because I just spent all day building and submitting 13 apps, and don't want to do it again if it's not necessary. As long as it's not going to affect the app or cause a problem in the review process, I'd like to just leave the apps as is. At least until they're updated.
     
  30. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @john, the code doesn't magically run on it's own so as long as you arent calling the push methods no push code will ever run.
     
  31. jbaumann

    jbaumann

    Joined:
    Dec 2, 2012
    Posts:
    1
    Hi
    Also having a problem Apple rejecting an app because of the push notification.
    I followed the procedure on the Etc plugin doc page: I deleted AppControllerPushAdditions.h and . mm in the unity project in Assets/Editor/Etcetera.
    Also deleted include in EtceteraManager.mm. Built and ran okay, but I got one warning : in EtceteraManager.mm,
    "Semantic issue. Instance method -imageWithImageDataMatchingOrientation not found"

    Now the app is crashing when I invoke the photo picker with PromptForPhoto().

    I realize a workaround to this is to set up register for push with apple, bit is there any way I can have the photo picker without push?
    Thanks
     
  32. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jbaumann, if you purchased from our store fetch the latest update that went out a couple hours ago. If you purchased from the Asset Store it will take a few days for them to review the update.
     
  33. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    Hi Prime,

    We updated the plugin, deleted the 2 AppControllerPushAdditions files, built and submitted to Apple just now. Still getting the same warning email from Apple though. Not a big deal though just FYI.
     
  34. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @serious, I'm afraid that is all that we can do. By removing those 2 files (assuming you are on the latest version of the plugin) there is zero push code left in the plugin. Unity's binary does have some push code in there which is probably what is causing the warning.
     
  35. milkie

    milkie

    Joined:
    Aug 8, 2012
    Posts:
    6
    Is the etcetera plugin capable of adding a second recipient to an email when using showMailComposerWithAttachment? I can't tell from the sample code or docs.

    I'm giving users the option to CC our company with the photos they share so we can post them on our website, but I'd like to put our email in the CC field rather than the address field so they are less likely to accidentally edit or delete our email address while entering the address of the recipient they want to send their image to.

    Or perhaps there's a more behind-the-scenes way to do this?
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @milkie, only one recipient is supported.
     
  37. milkie

    milkie

    Joined:
    Aug 8, 2012
    Posts:
    6
    @prime31 Thanks for the fast response - and the awesome time-saving plugins!
     
  38. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,116
    Greetings!
    I have a new issue on the following( my versions are a bit out of date, but hopefully there is something one can do):
    iOS
    Etcetera ( Etcetera_2012-04-09.unitypackage)
    Unity3d 3.5.5f3 , Xcode 4.5
    Ipad3 iOS 6.0


    Issue:
    doesn't seem to do anything on iOS (prior to this there is a Debug.Log() to make sure the function is called, the scene contains an EtceteraManager)
    also, other Etcetera functions like

    EtceteraBinding.showAlertWithTitleMessageAndButtons
    and

    EtceteraBinding.showBezelActivityViewWithLabel

    work fine
     
  39. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @yuri, the only way the email composer will do nothing is if you have no email account setup.
     
  40. 3duniversalimage

    3duniversalimage

    Joined:
    Sep 26, 2012
    Posts:
    14
    i am getting this error when i compile an empty project with the default etcetera unity package.

    Undefined symbols for architecture armv7:
    "_OBJC_CLASS_$_MFMessageComposeViewController", referenced from:
    objc-class-ref in EtceteraManager.o
    "_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
    objc-class-ref in EtceteraManager.o
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    please reply me as soon as possible
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @3d, your Xcode project is missing the MessageUI.framework in the build settings.
     
  42. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,116
    Gratitude! that was indeed the case - is there a way though, to notify the user - something like EtceteraBinding.GetEmailAvailable?
     
  43. 3duniversalimage

    3duniversalimage

    Joined:
    Sep 26, 2012
    Posts:
    14
    ok i have added the MessageUI.framework but after adding this and running the game in the ipad i am getting a black screen no button in the scene,

    i have check whether i have added the scene in the build setting i have added that too. is their any setting is their to enable this plugin sir.

    i am getting this error in your example scene which comes along with the plugin sir.

    Please help me sir
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @3d, you will need to contact Unity for rendering issues. Our demo scene is nothing more than an OnGUI method and buttons. Something is seriously wrong with your Unity install or project.
     
  45. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hi !

    A few questions :
    - Actually, there is no way to know if a user received a remote notification while running the app, or if he clicks the notification to open the app ?
    - Same things for local notifications, is there a way to know if the user click the notification to launch the app ?
    - Also, why there is no call back called when a local notification is triggered ?

    Thanks !
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nah0y, use the demo scene and watch the logs. Every event is logged. Read the documentation as well which lists every available event.
     
  47. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Well, for Etcetera1, we received the same listener "remoteNotificationReceived" wether we received this when we are running the app, or if we click on it from the notification bar.

    So there is no way to know if a user press the notification to OPEN the app or if he's already running the app :/


    And for the local notifications, I never EVER receive something in the logs via your listener in the demo scene, if I'm running the app, or just clicking on the notification, I have nothing.
     
  48. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    It seems an update is available that fix the issue, thanks a lot !

    BUT :) things are not working everywhere :/
    PS : I'm using the demo scenes that comes with the package

    For remote notifications :
    1. in AppControllerPushAdditions -> applicationDidFinishLaunchingNotification, there is the code
      Code (csharp):
      1. [appCon perfo]
      I think this is something you forgot to remove in the code right?
    2. If the game is running and I receive a push notifications, I receive the event remoteNotificationReceived TWICE (FAIL)
    3. If the game is closed, and I click on a notification to open it, I receive the event remoteNotificationReceived after 3-4 seconds, it's not instant (FAIL, I should receive remoteNotificationReceivedAtLaunch, and also instant?)
    4. If the game is running (in the background), and I click on a notification to open it, I receive the event remoteNotificationReceivedAtLaunch (SUCCESS)
    5. If the game is closed, and I open the game with the icon (not the notification), I receive nothing (SUCCESS)

    Maybe, the issue #3, is because in applicationDidFinishLaunchingNotification, you're calling handleNotification but without passing isLaunchNotification=TRUE ?

    For local notifications :
    It seems you added localNotificationWasReceived and localNotificationWasReceivedAtLaunch, but they are never used in the iOS code, I assume this is because it's a work in progress? But if so, why release the plugin with those events?

    Hope it helps !
     
    Last edited: Feb 25, 2013
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nah0y, I dont think you understand how notifications work. It is only considered a launch notification if the notification causes a new instance of your app to be instantiated. Apple sends a normal notification if the app is backgrounded but still in memory
     
  50. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    We're ok with this, but then the followings behavior are wrong :
    - If the game is closed, and I click on a notification to open it, I receive the event remoteNotificationReceived after 3-4 seconds, it's not instant
    - If the game is running (in the background), and I click on a notification to open it, I receive the event remoteNotificationReceivedAtLaunch