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. How to add Target in Qt IOS project file eg. share extension ?
Forum Updated to NodeBB v4.3 + New Features

How to add Target in Qt IOS project file eg. share extension ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
11 Posts 8 Posters 3.6k Views 4 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.
  • P Offline
    P Offline
    pkumar
    wrote on last edited by
    #1

    Hi,
    i just want to add share extension for IOS in qt project. i can easy add extension through xcode but unable to do it through Qt Project file. is there any way to add extension directly in qt project file.

    T 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What do you mean by share extension ?

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

      P 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        What do you mean by share extension ?

        P Offline
        P Offline
        pkumar
        wrote on last edited by
        #3

        @SGaist we are trying to build mobile app on IOS using QT. After running qmake the "project.pbxproj" file is getting created then we are using xcode to edit the project file ant adding share extensions using "File > target > share extension" then we use "make" this process can we do it automatically using command line or shell script. basically we want to automate the build process.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If I understood things correctly, adding these extension is essentially updating the Info.plist file with additional keys and corresponding values.

          One thing you can do is to copy the final Info.plist generated with Xcode in your project and use that one for your application rather than the one automatically generated. See here for more details.

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

          1 Reply Last reply
          0
          • GTDevG Offline
            GTDevG Offline
            GTDev
            wrote on last edited by GTDev
            #5

            Hi!

            You might want to try V-Play Engine, which makes Qt mobile development easier e.g. with built-in components like NativeUtils::share to trigger a native share dialog on iOS or Android devices from within QML.
            The engine also automatically links required frameworks and supports modifying the used Info-Plist in Qt-Creator.

            import VPlayApps 1.0
            
            App {
              id: app
            
              AppButton {
                text: "Share Website"
                onClicked: nativeUtils.share("This is shared using the native device share dialog.", "http://www.v-play.net/qt")
              }
            }
            

            Best,
            Günther

            Senior Developer at Felgo - https://felgo.com/qt

            Develop mobile Apps for iOS & Android with Qt
            Felgo is an official Qt Technology Partner

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tk.fs
              wrote on last edited by
              #6

              Hi, did anybody find a solution for this? I'm having the same problem with iOS Today Widgets (that's the stuff you get when you swipe down from the top of your iOS screen). Basically it works, but with every run of qmake you need to manually open XCode, "File > Target > Today Widget" and add the source files again. This makes building with Qt really tedious and automatic building is out of the question.

              @SGaist: your comment about the Info.plist does not cover this topic. Basically a new target is created within the XCode project file. The logic for how to compile and codesign this part is in the project.pbxproj file.

              What I found so far is that code generation for the project.pbxproj file takes place in pbuilder_pbx.cpp - but I have not found a solution to include XCode Targets (not Qt targets) to add iOS extensions. Most likely this could be solved by adding a new TEMPLATE type, but this is only my thought after looking through this for an afternoon.

              If anybody has any other ideas on how to solve this, I would be very happy!

              1 Reply Last reply
              1
              • U Offline
                U Offline
                upenya
                wrote on last edited by upenya
                #7

                After an hours of researching finally I've found a solution (using qmake).
                Create an empty xcode project, add some *Extension target to it. After build copy myextension.appex to directory named "PlugIns" inside main project (see https://codereview.qt-project.org/#/c/160746/), other directory names won't let qmake to embed extension correctly. Than add next lines to .pro:

                plugins.path = PlugIns
                plugins.files = $$IOS_PACKAGE_SOURCE_DIR/PlugIns/myextension.appex
                QMAKE_BUNDLE_DATA += plugins
                

                Hope it can be useful!

                1 Reply Last reply
                0
                • P pkumar

                  Hi,
                  i just want to add share extension for IOS in qt project. i can easy add extension through xcode but unable to do it through Qt Project file. is there any way to add extension directly in qt project file.

                  T Offline
                  T Offline
                  TobbY
                  wrote on last edited by TobbY
                  #8

                  @pkumar i think Qt currently doesn't support easy way right now to share extension through Qt Project file. the only possible way is to create an extension and add it to your info.plist.

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lockheed
                    wrote on last edited by
                    #9

                    @upenya Your code is only including .appex into the app bundle, but it's not adding a second target to the project. Am I wrong?

                    @TobbY Could you provide some more details about it? How to add extension with info.plist?

                    I think this is a pretty serious flaw. For example, there is no way to implement file sharing or push notifications without iOS extensions. There must be some kind of workaround.

                    ekkescornerE 1 Reply Last reply
                    0
                    • L lockheed

                      @upenya Your code is only including .appex into the app bundle, but it's not adding a second target to the project. Am I wrong?

                      @TobbY Could you provide some more details about it? How to add extension with info.plist?

                      I think this is a pretty serious flaw. For example, there is no way to implement file sharing or push notifications without iOS extensions. There must be some kind of workaround.

                      ekkescornerE Offline
                      ekkescornerE Offline
                      ekkescorner
                      Qt Champions 2016
                      wrote on last edited by
                      #10

                      @lockheed said in How to add Target in Qt IOS project file eg. share extension ?:

                      I think this is a pretty serious flaw. For example, there is no way to implement file sharing or push notifications without iOS extensions.

                      File Sharing is working - see my example project and Qt Blog Series about sharing
                      https://github.com/ekke/ekkesSHAREexample

                      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                      5.15 --> 6.8 https://t1p.de/ekkeChecklist
                      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                      L 1 Reply Last reply
                      1
                      • ekkescornerE ekkescorner

                        @lockheed said in How to add Target in Qt IOS project file eg. share extension ?:

                        I think this is a pretty serious flaw. For example, there is no way to implement file sharing or push notifications without iOS extensions.

                        File Sharing is working - see my example project and Qt Blog Series about sharing
                        https://github.com/ekke/ekkesSHAREexample

                        L Offline
                        L Offline
                        lockheed
                        wrote on last edited by
                        #11

                        @ekkescorner I've already read your series, and really appreciate it. But, there are several functionalities, which can't be achieved without shared extensions, like push notifications.

                        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