How to add Target in Qt IOS project file eg. share extension ?
-
Hi and welcome to devnet,
What do you mean by share extension ?
-
@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.
-
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.
-
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 -
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!
-
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!
-
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. -
@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.
-
@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.
@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 -
@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@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.