Exiting an iOS App

What's the proper way to do that? NativeApplication.nativeApplication.exit() doesn't seem to work on the iPad (works for Android, and Desktop AIR)

Duplicate of: http://forums.adobe.com/message/3779052#3779052

Similar Messages

  • Will exitting an iOS app programmatically lead to rejection from Apple app review?

    I am developing an iOS application which communicates with a web app and shows some informaton which is relevant to the user.
    In case there is no connection to the web server, the application can't function properly, because it doesn't cash any data.
    Therefore I am notifying the user in case there is no connection to web server with an alert view (The web server is currently unavailable, please try again later). I'd like to include an option in the alert view for the user to quit the application.
    Originally, after the user clicked the "OK"  button in the alert view I exitted the application programmatically, but I read from apple documentation that it is not a good practice and it could lead to rejection from app review.
    Is it alright to exit the application programmatically after user click on "Exit app" when the alert view appears or should I only notify the user to quit the application by himself? Would the first approach lead to rejection from App review? Thank you for your responses.

    Why not just provide a refresh button, rather than making the user restart the app?
    If this scenario is caused by the device losing network connectivity, you could also add Reachability logic so the app knows when network connectivity is restored, and automatically refreshes.
    SCNetworkReachability Reference
    https://developer.apple.com/library/ios/documentation/SystemConfiguration/Refere nce/SCNetworkReachabilityRef/Reference/reference.html

  • NativeApplication.nativeApplication.exit(); problem in iOS app

    Have this function called to exit an iOS app:
    function ExitApp(event:MouseEvent):void {
              listenIO(urAt,0);
              trace('NativeApplication Exit');
              NativeApplication.nativeApplication.exit();
    The function is triggered as the listenIO() does its thing and the trace() triggers, but no exit(). Closing the iOS app by the hardware menu button exits but when re-entering the app, it is stll where it was left and I don't have a function to return to a preset state.
    Help to exit the app appreciated, thank you.

    One way to get around exit() not working on iOS might be to set the following property in your iPhone section of your app XML:
    <iPhone>
              <key>UIApplicationExitsOnSuspend</key>
              <true/>
    </iPhone>
    That would force your application to exit on suspend (aka the user pressing the hardware button)

  • Air 3.3 and background ios apps

    Hi All
    I cannot find some coherent information on this so I am asking here.
    I need to write an iOS app that needs to perform a webservice call every x minutes to update the slqite db on the device, even if the application is not running in the foreground.
    From google what I could find out was that iOS will only allow your app to run a small time after closing(to finish an upload etc).
    e.g. "AIR does not provide support for this iOS background processing model":  http://www.adobe.com/devnet/air/articles/considerations-air-apps-mobile.html#articleconten tAdobe_numberedheader_5
    but then later " applications may now support location updates and networking in the background": http://forums.adobe.com/message/4380335http://forums.adobe.com/message/4380335
    Can I do what I need in Air 3.3+ an iOS 5.1+ ?
    Thank You

    Some of the statements in this thread are no longer true, or need to be updated.
    Here is a recap:
    As of AIR 3.9, background execution will work on iOS+Android with render mode set to 'direct' ( which implies that you are using Stage3D ).
    For background execution to work in iOS, you need:
    to set NativeApplication.nativeApplication.executeInBackground = true, in your as3 code somewhere ( note: strangely, background exec on iOS has worked for me in the past even by not doing that ).
    to add in the iPhone section of your app manifest ( *-app.xml ):
    UIApplicationExitsOnSuspend = false
    UIBackgroundModes = audio ( and/or location, or some other background mode ).
    a good excuse / reason :  since battery-gate on the iPhone4, Apple has  tightened its policies regarding background execution.  For example:  last time I tried, setting UIBackgroundModes=audio was only allowed if the app was intended to play a sound persistently in the background ( not occasionally, such as an alarm clock sound ).
    For local notifications, I recommend Distriqt's local notification ANE ( Android+iOS), since it's the ony one I know which uses the AlarmManager api on Android ( Koesler's Android Local notif doesn't last time I checked ).  This means that on Android, the local notification can be scheduled for a later time ( same as iOS ), and will fire EVEN if the app is either minimized or has been closed properly ( meaning closed by the OS, or by the user via NativeApplication.nativeApplication.exit() -- note: force-stopping is the exception and cancels scheduled notifications on Android ).  You can also have the local notification play a custom sound which is up to 30 secs long ( mp3s on Android / cafs on iOS).  Sound will be audible on both platforms, even if the device is suspended.  This is ideal for an alarm-clock, for example.  The downside of local notifs is that they don't execute code, per se, however they can pass a data payload ( text ) back to the app, if it is running ( even if minimized ), which a handler can receive to do stuff.

  • Upgrade an iOS app made in Flash CS5 to Flash CS5.5

    Hi, I developed an App and I published it on the Apple App Store about a month ago, when I was still using Adobe Flash CS5.
    Now I bought the latest version of Adobe Flash, the CS5.5 and I want to upgrade my exiting app with the Retina Display support.
    The problem is that when I try to upload my IPA into Application Loader, it gives me a strange error... it says that I can't upgrade my app because I'm using an higher mininumOSVersion......in fact Flash CS5 has got a 3.0/3.2 minum and the CS5.5 4.0/4.2........How can I change them and upgrade my app???
    Please, help me it's for an important company... 
    bye and thanks
    Brandon

    Here is my understanding of the updating rules for iOS apps. Once you publish an app targeting a specific OS, any further update to that app must target that OS. Since Flash CS5.5 only targets 2.6 and later, which has a dependency on iOS 4 or later, you are as you discovered stuck. I think you solution is to create a new version, "My Awesome App HD" and then publish via CS5.5 to get the performance and Retina support you want.
    Chris Griffith

  • IOS apps continue to use CPU after iPad sleeps

    I've created several AIR -iOS apps for iPad and have noticed that after the iPad sets itself to sleep, these apps continue to use a % of CPU indefinately, (around 2%).
    I'm seeing this by using XCode Instruments Activity Monitor whilst the iPad is connected.
    The apps have been created with:
    Flash Pro CS5.5
    AIR 3.2
    Tested on iPad1 and iPad2.
    Would anyone know if there is there a reason for this, what could be causing it and is there a fix?
    Thanks,
    Mark
    UPDATE:
    Allowing the iPad to sleep does maintain a CPU usage of around 2% for the AIR apps, whereas closing the app with the home button sets the CPU usage to 0, even with the app not exiting on suspend.
    When a native app is running when the iPad sleeps its CPU usage does return to 0%.
    I wonder what the AIR app is doing?????

    Hi Peter, 
    Thanks for your reply. 
    If Ask to Buy is turned on, the organizer should have to approve new purchases, including free apps, before they are billed--either to the organizer's card or to the family member's gift card balance. 
    The organizer must use a credit or debit card to pay for family member purchases. 
    You can find more detail at these links:
    Request and make purchases with Ask to Buy - Apple Support
    When a family member initiates a new purchase or free download, a request is sent to the organizer if Ask to Buy is on.
    How iTunes Store purchases are billed - Apple Support
     iTunes Store credit on your account isn't shared with other family members. So if the family organizer has a $50 credit on their account and another family member initiates a purchase, it won't deduct from the organizer's iTunes Store credit, but will bill the organizer's credit or debit card.
    For additional clarification on Family Sharing, you may want to reach out to Apple Support using this link: 
    https://getsupport.apple.com/GetproductgroupList.action. 
    All the best,
    Jeremy

  • My itouch wont exit from an app and won't turn off.

    My itouch wont exit from an app and won't turn off. I've tried assistive touch. I can do stuff on the app but can not leave the app. PLEASE HELP!

    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup. See:                                 
      iOS: How to back up

  • Secon iOS App: BirdWatching crashes

    Hi!
    I've problems adding birds to my list ... ;-) There's a problem using the plus Button in the upper right corner in the navigation bar.
    The simulator crashes. This is the information in the debug console:
    2012-09-16 09:44:23.729 BirdWatching[1488:c07] -[AddSightingViewController viewControllers]: unrecognized selector sent to instance 0x6839cc0
    2012-09-16 09:44:23.757 BirdWatching[1488:c07] Exception - -[AddSightingViewController viewControllers]: unrecognized selector sent to instance 0x6839cc0
    It's reduced to this because i've added a try / catch and modified NSLog.
    int main(int argc, char *argv[])
        int retVal = 0;
        @autoreleasepool {
            NSString *classString = NSStringFromClass([BirdsAppDelegate class]);
            @try {
                retVal = UIApplicationMain(argc, argv, nil, classString);
            @catch (NSException *exception) {
                NSLog(@"Exception - %@",[exception description]);
                exit(EXIT_FAILURE);
        return retVal;
    I'm using XCode Version 4.4.1 (4F1003) and iPhone 5.1 simulator to compile  and run. If you leave the main.c as it is, XCode shows an error on the line with UIApplicationMain command.
    Can somebody help?
    Oliver

    I fixed it! I had to read the documentation twice and one more time ....
    On page 1 they mentioned to deploy this program to 5.0 or later ...
    "To create the iOS app in this tutorial, you need Xcode 4.3 or later and the iOS SDK for iOS 5.0 or later."
    OK. 5.1 is definitively later ... but it didn't work.
    The first time i stepped throught the cookbook i wondered that there is no navigation controller right beside the AddSightingViewController (in the apple tutorial, only text, no pictures). I control-dragged the table-view-controller and there is already one nav-controller!
    Yesterday i decided to do it once again. Then i came to the very first settings of my new project.
    There is an overview to set the layout and device-orientation, app icons and launch images and also deployment target. Default was 5.1. I switched it "back" to 5.0 and began to "develop". Now, when i control-drag the table-view-controller it's only this one, no extra nav-controller.
    At the end - it runs, without an error! I learned a lot these hours .... Maybe i try to fix the apple tutorial to use it with 4.5. Let's have a look on apple tutorials the next days with xcode 4.5 and ios6.
    Oliver

  • AiO Remote iOS app -scanning A4

    I have a Photosmart 5515 All in One printer and have been using the iOS app AiO Remote app to scan in some A4 pages. I set the app to scan to a document and also the page size to A4. Looking at the resultant document it has scaled the the document down. It has centralised the document but you end up with margins of a couple of inches all round.
    Has anyone else noticed this?
    Does anyone know how to overcome this?

    Hi Rturner003,
    Welcome to the HP Support forums.  I understand that you are encountering difficulties when scanning A4 documents with HP's All-in-One Printer Remote app.
    I did some testing on this with an iPad and 3 different ePrint capable printers and each time I was able to recreate it. However that doesn't mean we are kippered.  I have included a link to a post on the forums and the key part for you to get your A4 scanned document to print the document as you require, please follow step 3 after you have scanned the image. The key is to pinch the image to the size you would like.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • Can I use iCloud storage for iOS apps?

    Hello,
    I'm trying to work out if it's possible to use iCloud to save/load data across devices with iOS apps created using Air.
    I know there is a lot of talk about now meeting the Apple data storage guidelines eg http://www.saumitrabhave.com/2011/11/air-ios-solving-apps-must-follow-ios.html
    What I can't understand is if I actually want to use iCloud to save data a user has created in my app (ie condition 1 of the storage guidelines - user generated data, cannot be re-created by application).
    If I was to save this user data to the <Application>/Documents directory...
    a) would it be backed up by iCloud and meet Apples requirements?
    b) if my application was installed on another device is there any way, using Air/AS3, to know that a file has been updated and read the file?
    Please let me know if this doesn't make sense... still trying to get my head around how it all works.
    Thanks.

    More details are available at http://blogs.adobe.com/airodynamics/2012/03/05/app-compliance-with-apple-data-storage-guid elines/

  • HP ePrint iOS app no longer finds Photosmart C4780 after app update

    I have an HP Photosmart C4780 connected through WiFi to my network but sadly it's not supported by AirPrint on iDevices.
    So, I was using HP ePrint Home & Biz iOS app (version 4.1) which was very useful for me as it found the printer and allowed me to print from my iPad/iPhone. 
    Today I updated the app on my iPhone to version 5 (now simply named "HP ePrint" on the App Store) and after the update, the new version doesn't find my Photosmart C4780 anymore. I did the Activation thing on the iPhone, as it was requested to refresh the list of printer on my network in the All tab, but after Refresh no printer is found.
    Still I have the old 4.1 on my iPad (and hopefully in my iTunes library) and the printer is located, I assume, through mDSN as it shows the name specified for this setting.
    So, question is: Did you dropped support for Photosmart C4780 on 5.0 release of HP ePrint iOS app? If so, why did't you informed this appropriately on the app update text description in the App Store? A message like "some printers may not be supported anymore" would have been helpul.
    If HP ePrint should find Photosmart C4700 series printers and this is an issue, how should we proceed from here?
    Thanks.

    WilliamBPS, 
    I was not informed that support was removed from the app for certain printers. It may have been lost in the transition to the new updated app. I will deffinitly pass this information along as it is very important that the app supports as many printers as it can. I'll go ahead and take note of your printer model. If I find anything out about this, I'll try to give you an update in this thread. 
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • Sync iOS Apps to iTunes - Questions on how exactly this works...

    I'm going to put my questions up top, but my understanding of the current system is below, and may be relevant to the questions, if you'd like to read through it.
    How can I back up / restore a SINGLE app, including its data (e.g. a game save file), to either iTunes or the cloud... or anything else for that matter. Does syncing an app to iTunes serve this purpose?
    What IS the purpose of syncing an iOS app to iTunes? Does this sync include the data stored on my iOS device? For example, if I have a game in which I've made progress, is this progress stored on both my iPhone and my Mac once I've synced the app to iTunes?
    If data IS synced along with the app, how is this data managed? Say I have two iPhones, both with the same game but different progress in each. If I sync iPhone A with iTunes, then sync iPhone B, will iPhone A's data overwrite iPhone B's? Or are there two versions of this app floating around on my mac?
    If data is NOT synced along with the app, why on earth would I want a bunch of huge storage-hogging iOS apps that are identical to what I could download from the App Store taking up GIGABYTES of space on my MacBook's SSD?
    And finally, should the answer to question 4 be "there is no reason to store 42GB worth of useless apps on your 256GB SSD alongside your already gigantic iOS device backup files," how would I go about removing these apps stored in iTunes without iTunes trying to delete them from my iOS device every time I want to sync some TV shows or podcasts?
    My Understanding So Far:
    Of the many things Apple has addressed and improved upon over the years, backing up iOS app data has strangely not been one of them. As I understand it, the only way to back up an app, including its data (e.g. the save data for a game), is to do a FULL backup of the ENTIRE device. The only way to restore an app, including the data that you backed up, is to restore the ENTIRE device, all other apps included, to a previous state.
    The driving force behind these questions is that I'd like the option to delete an app from my iPhone when I'm finished with it - but I'd also like the option to re-download it in the future and pick up where I left off. In a perfect world, all these apps would automatically sync through iCloud or GameCenter, or at least have that option to "upload to iCloud" or "restore from iCloud." Even with these apps, I'm not entirely sure where the backed up files exist - somewhere on my iCloud drive separate from my iPhone backup, photos, contacts, etc? Is there a way to see a list of apps that are storing things in my iCloud drive, and even manage this data?
    So if I wanted to back up an app's data that does NOT automatically back up to iCloud, it seems my only option would be to install one of the many 3rd party Mac <-> iOS data transfer apps, and copy the contents of the "Documents" folder to a designated directory on my Mac. Then I could delete the app off my iPhone. Say in the future I re-download the app - I'd use the same data transfer app to copy the backed-up data to the re-downloaded app's Documents folder, and we're back in business. The only downside is that if it's been a while and the app has undergone updates, this backed-up data might be corrupt or no longer relevant. Plus, it's kind of a hassle.
    When I discovered iTunes was syncing my apps to my Mac, I thought it might be serving as a way to back up my apps, data included, to my computer. Okay, it seemed like a little overkill to sync the whole app along with the data, but when I discovered that you could UPDATE the apps within iTunes, I thought apple had solved the problem of storing backed-up data for out-of-date versions of an app - simply update the app in iTunes, it does what's necessary to your backed-up data, and when you want to put the app back on your iPhone, voila! Your old data's there, AND you've got the most recent version! But apparently this is not at all how iTunes app syncing works.
    As I NOW understand it, when iTunes "syncs" an app to your Mac, it includes only the app's core data - the same as if you'd just downloaded it from the App Store, and it does so for EVERYTHING you've purchased, ever, whether or not it's on any of your iOS devices. I can see how this could be convenient if you live on a farm and want to restore an old app to your iPhone without an internet connection, but I don't think it's worth, unexaggerated, a FIFTH of my hard drive. Worse, I can't figure out how to get rid of them.
    TL;DR
    So, if you're still with me, what is the purpose of iTunes App Sync, and if it's as useless as I think it is, how do I get rid of it for good?

    You can upgrade to Snow Leopard and skip over Leopard, and only upgrade to Lion later if wanted/needed. snow Leopard specs/requirements below.
    http://store.apple.com/us/product/MC573Z/A?fnode=MTY1NDAzOA
    Stedman

  • Is it still possible to create a 32-bit only iOS app?

    With the latest AIR release (17), is there any way to still create a 32-bit only iOS app for testing on the iPad 1? It's currently not possible to install an app with 64-bit support on an iPad 1 to test the app. My understanding, however, is that Apple will do something on their end that will allow apps submitted to the App Store (with 64-bit support) to still be downloaded and installed on an iPad 1. Having a way to test on the iPad 1 before submission to Apple would be nice.
    Is there a compiler switch or something that can be used for this purpose? If not, could such a switch be added easily? If we had such an option, we could continue testing on and supporting the iPad 1. Being in the education market, this is kind of critical to us.
    Thanks,
    Chris Sheffield
    Read Naturally, Inc.
    www.readnaturally.com

    Because an app built with 64-bit support *cannot* be installed on an iPad 1 device for testing purposes, whether using iTunes or Xcode. It simply doesn't work. This is the message generated by Xcode:
    This is when trying to install an app built with Flash Builder 4.7 and AIR sdk 17 beta.
    As I stated before, my understanding is that Apple will still allow installing apps on an iPad 1 through the App Store, but *only* through the App Store. In my opinion, this is too late. We really need a way to continue testing on the iPad 1, if at all possible. That's why I'm asking if there's a possibility of adding a compiler switch of some kind that would allow building 32-bit only apps, for testing purposes only.
    Thanks.

  • Is there any downside mixing Objective-C with C++ for iOS apps?

    I'd like to use C++ since it's fast and more dynamically in memory reference.
    Is there any downside mixing Objective-C with C++ for iOS apps?
    When googled for info, I only found tutorials about how to let xcode compile Objective-C with C++.
    Thanks for help.

    hokanst wrote:
    Both Objective-C and C++ are (more or less) extensions of C.
    C supports manipulation of pointers and casting of pointers, this implies that both Objective-C and C++ will be able to manipulate C data like arrays, structs ...
    Objective-C has classes like NSData to read/write blocks of bytes from/to file and to access ranges of bytes when the data is loaded into memory.
    C++ probably has similar classes (I'm not well versed in C++ so I don't know).
    If you want to look into using C++ you will probably want to look at Objective-C++, the link below has links to docs on how to use C++ with Objective-C:
    http://stackoverflow.com/questions/3684112/what-is-objective-c
    Thanks for the info, NSData does what I need.
    A replied in the link also mentioned that he's using C++ in his application too. As long as I'm aware of memory management (prevent memory leaks, etc) as @disguise said, it should be fine.
    @etresoft indeed, but C is the base language of ObjC, there are ways to deal with.

  • My first gen. iPad exits out of apps and safari at random times when I am trying to use them. So I basically can't do anything on it. Is there some way I can fix this?

    Crashing apps. What do I do to fix it?
    My first gen. iPad exits out of apps and safari at random times when I am trying to use them. So I basically can't do anything on it. Is there some way I can fix this?

    I have the same problem.  Yahoo Sportacular aborts every time I try to open it.  It attempts to load and then the device goes right back to the home screen.  The problem started April 26 after I switched leagues from NHL to NBA. Closing all apps and Restarting doesn't solve solve the problem.
    All other apps on the iPad work fine.  IPad2, OS6.
    Any other suggestions?  I suppose I could delete the app from the iPad and try re-installing it

Maybe you are looking for

  • How can i Restore Photo's from my previous Iphone 4s icloud back up!!!

    Hello guys i am new to apple discussion but here goes...     last month i had to get my iphone 4s replaced but before i did i made a back up on icloud, when i go on icloud on my new iphone, then go to manage storage it says i have 2 back ups, 1 from

  • Cannot edit iCloud storage credit card

    I need to update the credit card info used to pay for my iCloud Storage and when I go in System Pref>iCloud>Manage>View Account  I log in and can see the credit card info but when I try and edit it and save I get an error saying my session timed out

  • While Loop Freezes game

    i am coding for GTA IV the game freezes when i use this while loop while (tb == true) if (Game.isKeyPressed(begkey) && ip == false) beg_playing(); Game.Console.Print(begkey.ToString() + " Pressed"); Game.Console.Print("Animation Cleared"); Player.Cha

  • I would like to be able to remove the 'bookmarks toolbar' from the bookmarks menu.

    Recently Firefox had a .. problem. I'm not sure what it was, or why. I just opened it one day and it had to 'reset'. So, it did, and i lost a bunch of things like addons and themes and stuff like that. Its not a big deal, because all the data was sti

  • Time Machine dbfiles in Trash - how to recover?

    You'd think it would be easy - drag them back. Well, two hours later, its still clucking away, 'Preparing to Copy' over 12 million items and counting. Wow. Can I actually expect this to work? These are all my backups to May. Thanks!