I am trying to keep my application in the background on the iOS platform using firemonkey.
I have came across an answer witch tells me how to make the application remain in background.
Here is the answer:
You'll need to copy the info.plist file and modify it using a unix EOL
friendly editor (such as Notepad++). Add the following lines to it:
UIBackgroundModes voip
In the Deployment screen for your project, uncheck the original
.info.plist, and add the copy you modified. Note that if you
change any project options that changes the original, you'll need to
go thru this process again, or just reflect the changes in the
modified file.
How ever I can't figure out where is the Deployment screen. Does anybody know ?
(NOTE: I don't do iOS development, so this info is based on some quick experimentation with a new iOS FMX project in XE5.)
Those instructions are for XCode, which isn't Delphi. Delphi doesn't have the XCode deployment screen.
The Delphi equivalent is in Project->Deployment from the IDE main menu. You can locate the .plist file in the Local Name column, in the form YourProject.info.plist. I think the original copy is actually generated when you build your project for deployment (either Release or Debug) to the simulator or device, so you may have to do that first in order to find it.
If you look at the samples for XE5 (which seems to be the one in Samples\Delphi\DataSnap\connectors\iOSClients\client_company_tweet), you can see where they're located once the file has been generated.
Related
I have a project in App Inventor that uses the TinyDB. In this project, I added an extension I couldn't delete and didn't want.
To solve this problem, I made a copy of the app, downloaded the copy as an aia, unzipped the project and fixed the problem, and then zipped it back up.
Then I deleted the copy on AI so I could upload the changed version. Everything went according to plan, and now I have an app with the problem and a fixed project under a different name.
My question is if I delete the problem app and save-as the copy under the original name, will the tags in the TinyDB still be there or will they be in a separate database that I can no longer access?
I tested this question with a simple app I made. Here are the steps I followed, you can skip to the bottom if you want the conclusion:
Methods:
Create a project
Drag in a list view component, two textboxes, a tinyDB, and a button. It doesn't have to look pretty, it just has to be functional
Go to blocks
Add in the blocks below
Build the apk and install it on your device. Store at least 1 tag.
Go back to AI. In the project, click Project>save as... and leave the project name at the default.
Delete the original
In the copy, click Projects>save as... and set the name to the original name you used.
Build the apk and install it on the device. Do not uninstall the first app you installed.
Confirm that the entries you added are still in the app.
Conclusion:
When testing this, I found that the data in the tinyDB would persist from the other version of the app. I think this was because the project name was the same, I was signing the app with the same digital signature, and the tinyDB namespace was the same.
Therefore, it is safe to change the name of the app and then change it back without losing the data on a user's device.
Further steps:
I would also like to test if this works when downloading the aia, unzipping it, and then zipping it back up and uploading it. I think that would yield the same result, but I have yet to test it.
We developed an app for our client and it is now available in the app store. Lets call it the MAIN APP here.
Now the client wants a separate version of that app, without changing anything but just the name of the MAIN APP. Let's call it the ALT APP here.
The MAIN APP has two Xcode projects, one is the older one, the other is the latest, which is the one what I am working on with new features.
I uploaded the first version of the ALT APP before by changing the app name and bundle ID of the older project of the MAIN APP. So you can think of it that the older project of the MAIN APP is now the project of the ALT APP
Now I need to update the features of the ALT APP to the same as the MAIN APP.
One way to do this is to copy paste the source files of the MAIN APP and overwrite it to the source files of the ALT APP but I think this takes time.
The other way I thought of is to just change the app name and bundle ID of the latest project of the MAIN APP, upload the ALT APP and then later on change it back when I need to upload the MAIN APP
But I am afraid that if I kept on changing the bundle ID there will be build problems(although I haven't encountered any yet).
Is there any better way to do this? Thanks in advance!
Make One Project.
Go to Project setting -> Build Setting
Change
Current Project Version
As you want.
Duplicate your 'base' target as you want
Go to Target -> General -> Version
and Write $(CURRENT_PROJECT_VERSION)
Change bundle identifier.
Go to Target -> Info and find 'Bundle name' and change it. That will be your app name.
I wish you can solve your problem.
This sounds a lot like you need to look into branching in your source code repository. Git in particular is suited to pulling individual commits between branches. Thus allowing you to select changes to copy. Providing you are careful about what you are committing.
Ultimately it sounds like your project is going to end up being an old code based with patches and a new code base with new features. Perhaps your client is not clear enough about what they want. Keeping two version of an app current in the app store would be a headache. Far better to retire one and move with the new.
I wanted to release an app I worked on and quickly change the project name. I usually duplicate projects before doing things like this but this time - because this procedure always worked on Xcode as I found it way more reliable than e.g. Eclipse - I didn't, which I immediately regretted.
Opened Xcode again and now I am seeing this
I guess all the linking is gone now which is why Xcode doesn't "find" the files anymore. Renaming the remaining project stem to the old name gives
couldn’t be moved to because an item with the
same name already exists
and also manual renaming of folders won't work as the .xcodeproj is gone.
The project is written in Objective-C, and all the classes are still persistent, but the effort of adding all the xib's, referencing the outlets, setting architectures, etc will become the nightmare of my life. I do have a half-way recent backup but everything I did to make the app store-ready today will be gone.
Any ideas on how to rescue my project?
EDIT: What Xcode is now showing on the welcome screen is a project called "project" (literally) and it has the usual compass icon but with a white instead of a blue background referring to the path <project folder>/<new project name>/ and below that "white" project there is a folder icon with the new name pointing to <project folder>.
I also made a snapshot before, of course it now says "Unable to read snapshots" in the "restore from snapshots" window.
Ok what I now did is renaming ALL references from the old project name to the new one. I even changed file names. I used Xcode's CMD+SHIFT+F and TextWrangler's "replace" function and thankfully I still had the .xcodeproj from yesterday's backup so from there I could copy it into the new project and rename stuff. There are still some things that don't work perfectly, for example auto layout doesn't "stretch" contents over the screen (it stays on iPhone 4s size, even on 6 plus simulator), I needed to set the scheme again and Launch Images / Icons got lost but I can look over that. The only thing I am afraid of now is that the final build might miss out a symbol or something like that so I eventually have a corrupt file in the App Store, but man it's a beta version, how much worse can it get anyway?
Thanks to everyone recommending me to even backup the broken project, I did this even before you said it but because I think it's a valuable advice I wanted to put it in my answer as well.
It's a shame that stuff like this can happen, I've been backing up my work on a daily basis and my project never got corrupted - until now.
Every time I meteor build, I have to open XCode and do the following:
remove and add an item from "Link Binary With Libraries" (Facebook SDK)
add a URL Type (custom URL scheme for my app)
add a "Required device capabilities" to "Custom iOS Target Properties"
How can I edit my Meteor project to have these steps done automatically, and to auto add things to AndroidManifest.xml?
In some way use mobile-config.js or cordova-build-override?
I'm happy to see another guy who is trying to build a hybrid application using Meteor / extending a Meteor Cordova iOS app, since I'm facing the very same issues. So I'm very happy to share my experiences and approaches with you. :-)
So far, I ended up with the following approach:
I created a base template for my iOS app using meteor build (not meteor run ios-device, since I did not know if Meteor does some optimizations for production code).
Then, I copied the whole Xcode project under /platforms/ios to another loaction and used this new project as my "master" project from then on. This project is being enriched with native code, e.g. it also includes the Cocoa Pods I'm needing.
Of course, I also did not want to copy files each and every time I trigger a new Meteor build. At least, I would like to have the Staging/www folder updated, as this is happening quite frequently.
So my first (rather naive) approach was
delete the Staging/www folder in the master project
replace it with a relative link (using Xcode's linking functionality) to the Staging/www folder inside the .meteor/local/.../ios/ project
This approach did not work, since the shell script used in the Meteor Xcode project can't handle these links.
My second approach is to create a symlink on the filesystem level instead. This works as it should, and I'm able to build the project in Xcode as it should.
I could have followed the same approach for the Cordova plugins folder, but I've decided to replace the plugins manually in order to get a better control over them, even it means a bit more effort then.
Having the symlink in place also means that Xcode's version management (and also SVN which I am using for everything) will ignore everything below Staging/www, which is good in my opinion, because I'm already versioning the webapp code in the Meteor project itself.
BTW: I've started a discussion thread on hybrid mobile app on the Meteor forums as well, but so far it did not get too much attraction:
https://forums.meteor.com/t/building-a-hybrid-meteor-cordova-app-share-experiences/8212
Maybe we could follow up on Meteor-specific things there, to have the Meteor community participate in the discussion?
EDIT: I would also like to share an approach that failed completely, at least for me, maybe I was too dumb... Before I used Meteor's Xcode template as the starting point, I also tried it "the other way round", i.e. I started with my already existing Xcode app project and tried to include Meteor's / Cordova's part by hand. Using this approach, I never managed to set everything up correctly. I had lots of troubles and also had to tweak a lot of the compiler / linker flags to even get the code compiling. This grew me a lot of gray hairs. But even after I managed to get everything to compile, Meteor hang during startup - and I never figured out why.
One remaining problem I'm still facing is that Meteor's hot code push functionality seems to have some severe issues on iOS, that are also documented as GitHub issues. It can happen that the iOS app gets completely broken and needs to be reinstalled. I tried the mdg:reload-on-resume package, but this did not work as it should and made things even worse. As far as I can tell from the GitHub discussions, one should better disable hot code push until the Meteor team has addressed these issues. Breaking the app completely due to code pushes is not what my users would expect.
Unfortunately plist values (and assumably AndroidManifest.xml as well) can only be changed by a plugin:
Add entry to iOS .plist file via Cordova config.xml
I have a Xamarin.iOS app. It links to a C# PCL. Within the PCL, I have a text file Foo.txt. Its build action is set to Content and Copy Always. Yet when running on the iOS simulator from Visual Studio, I usually can't find it anywhere in the app bundle.
One time I actually did find it, at:
PortableLibrary/Foo.txt.
But other times it has not appeared. What could be the matter?
Just tested it on the latest Xamarin.IOS version and it works just fine. Make sure that you rebuilt after changing the file settings. But its not found within the .app file if thats what you mean.