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. Qt iOS Background Modes not applied?
Qt 6.11 is out! See what's new in the release blog

Qt iOS Background Modes not applied?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 634 Views
  • 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.
  • A Offline
    A Offline
    adddeeee
    wrote on last edited by
    #1

    Hello,

    I am trying a simple example to learn how to apply Background Modes on iOS.

    It works perfectly fine in the simulator, but when running on my phone it does not.

    So, I have enabled ALL background modes in Xcode, just to be sure. In QML I have a timer counting seconds.

    In the simulated version in Xcode everything works as expected even if the simulated phone is locked. Running on a real target the app pauses as soon as home button is pressed.

    Am I missing something important? So far I have tried applying the background modes in Xcode, but also I have manually inserted the UIBackgroundModes key in Info.plist. Moreover I also included the file in my Qt project and added if to the .pro file:

    QMAKE_INFO_PLIST=$$PWD/Info.plist

    My Info.plist looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIconFile</key>
    <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>${QMAKE_SHORT_VERSION}</string>
    <key>CFBundleSignature</key>
    <string>${QMAKE_PKGINFO_TYPEINFO}</string>
    <key>CFBundleVersion</key>
    <string>${QMAKE_FULL_VERSION}</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
    <string>${IPHONEOS_DEPLOYMENT_TARGET}</string>
    <key>NOTE</key>
    <string>This file was generated by Qt/QMake.</string>
    <key>UIBackgroundModes</key>
    <array>
    <string>location</string>
    <string>audio</string>
    <string>bluetooth-central</string>
    <string>bluetooth-peripheral</string>
    <string>external-accessory</string>
    <string>fetch</string>
    <string>location</string>
    <string>processing</string>
    <string>remote-notification</string>
    <string>voip</string>
    <string>newsstand-content</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    </dict>
    </plist>

    I am confused. How can it work smoothly in simulation, but not at all in target? Am I missing something regarding Info.plist?

    1 Reply Last reply
    0

    • Login

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