Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Re-initializing an iOS app
Forum Updated to NodeBB v4.3 + New Features

Re-initializing an iOS app

Scheduled Pinned Locked Moved Solved Mobile and Embedded
ios
5 Posts 2 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DRoscoe
    wrote on 11 Mar 2016, 18:09 last edited by
    #1

    I have noticed that many apps for iOS which require external network services will re-initialize themselves upon waking up from a suspended state, up to and including bringing up the initial splash screen. Is there any trick to this, other than manually cleaning up the app?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 11 Mar 2016, 23:29 last edited by
      #2

      Hi,

      Depending on what you want to do you will have to do some native code. Have a look at QIOSViewController and particularly viewDidLoad. You'll need to add an observer for the UIApplicationDidBecomeActiveNotification notification.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply 12 Mar 2016, 12:43
      0
      • S SGaist
        11 Mar 2016, 23:29

        Hi,

        Depending on what you want to do you will have to do some native code. Have a look at QIOSViewController and particularly viewDidLoad. You'll need to add an observer for the UIApplicationDidBecomeActiveNotification notification.

        D Offline
        D Offline
        DRoscoe
        wrote on 12 Mar 2016, 12:43 last edited by DRoscoe 3 Dec 2016, 12:43
        #3

        @SGaist Looking at
        [QIOSViewController]https://github.com/qtproject/qtbase/blob/dev/src/plugins/platforms/ios/qiosviewcontroller.mm

        I don't really see anything there that's relevant to my question. I'm trying to figure out if there is a way to re-initialize my iOS app when it gets foreground context back. I see other apps do it. For example, Clash of Clans. When it gets suspended, and you bring the app back to the foreground, it comes back up with the last screen shown and then within a second or two, it goes back to the splash screen sequence and re-initializes the app. Our app is written as if it were a pretty non-tablet app, so I was wondering if there were a "trick" for doing stuff like that on tablets, such as a state machine, etc, to make that initialization happen, or is it done the traditional way.

        I apologize if my question is not clear. I am not sure I a communicating well

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Mar 2016, 21:05 last edited by
          #4

          Well, that's the starting point. You have to catch the notifications and act accordingly. viewDidLoad is called when your view comes to life and UIApplicationDidBecomeActiveNotification is what you will receive to tell you that the application became active so you can do what you want e.g. reinitialize stuff etc.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply 13 Mar 2016, 05:53
          1
          • S SGaist
            12 Mar 2016, 21:05

            Well, that's the starting point. You have to catch the notifications and act accordingly. viewDidLoad is called when your view comes to life and UIApplicationDidBecomeActiveNotification is what you will receive to tell you that the application became active so you can do what you want e.g. reinitialize stuff etc.

            D Offline
            D Offline
            DRoscoe
            wrote on 13 Mar 2016, 05:53 last edited by
            #5

            @SGaist OK, I understand now. Thanks!

            1 Reply Last reply
            0

            1/5

            11 Mar 2016, 18:09

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved