How to change iOS app name based on Flutter Flavor? - ios

I have 4 flavors for my flutter app and I want to give different app name for each of them. I found some answers about how to do it on Android, but couldn't find anything concrete for iOS.
I tried making changes to product name in build settings and info.plist file, but no luck. Can anyone help ?

Related

AVFAudio Framework not present on macOS causes warning for iOS app (app should also be available on AS Macs)

My iOS app uses the AVFAudio framework to provide spoken feedback to the user while running. I would like this app to also run on Apple Silicon Macs (where the spoken feedback is not really necessary).
However, just importing the framework results in the following warning email after I upload to App Store Connect:
We identified one or more issues with a recent delivery for your app,
"App Name" 7.0 (24). Your delivery was successful, but you may wish to
correct the following issues in your next delivery:
ITMS-90863: Apple silicon Macs support issue - The app links with
libraries that are not present on Mac:
/System/Library/Frameworks/AVFAudio.framework/AVFAudio
I guess that this means the app will not be able to run on Macs.
How should I get this app to use the AVFAudio framework for iOS and still be available to run on macOS (AS Macs) with or without the framework on macOS?
Relevant code is:
import AVFoundation
class Speaker {
var speechSynth: AVSpeechSynthesizer
class func establishAudioSession() {
do {
try AVAudioSession.sharedInstance().setCategory(.playback, options: [.interruptSpokenAudioAndMixWithOthers, .duckOthers])
try AVAudioSession.sharedInstance().setMode(.voicePrompt)
try AVAudioSession.sharedInstance().setActive(true, options: [])
UPDATE / CLARIFICATION:
Note that my project does not include multiple targets. With multiple targets, this would be fairly straightforward. I am wondering if there is a way to achieve this by taking advantage of the newer AS Macs’ ability to run apps built for iOS without a separate target.
Is this possible when using this framework?
UPDATE 2:
I have submitted a support request to Apple for this now and their first suggestion was replacing
import AVFoundation
with
import AVFAudio
and then re-uploaded to App Store Connect, but after trying this, I get the same warning email back again. Will post an update (or hopefully an answer) when I hear back from them again.
I suppose your project has multiple targets defines (i.e. one for iOS and one for macOS). In the "General" tag of your target settings you can select which frameworks should be included under "Frameworks, Libraries and Embedded Content". Add your library for iOS, remove it for macOS.
If you share the same code you between apps you can also conditionally exclude some of it for macOS.
#if os(iOS)
// iOS only code
#endif
However, just importing the framework results in the following warning email after I upload to App Store Connect:
The problem probably isn't importing, but (as the message you got indicates), linking to AVFAudio, that's the problem. So solve that, you should select your app target in the Xcode project and go to the Build Phases tab. Look at the Link Binary with Libraries line and hit the disclosure button at the beginning of the line to reveal all the libraries that are linked into your app. Find AVFAudio and change the setting (there's a popup on the right side of the line) from Required to Optional. That'll let your app link to the framework if it's there, but still run if it's not.
But wait, you're not done yet... What do you think will happen if your app tries to actually use a framework that's not linked in (because it doesn't exist on the machine)? You'll get a crash, of course. To avoid that unhappy fate, you'll need to check for the existence of the framework before you use it. For example, you could do something like:
if NSClassFromString("AVAudioPlayer") != nil {
// do your AVFAudio stuff here
}
Further follow up from Apple support suggested the following:
Change back to import AVFoundation
Reduce the deployment targets from the latest and greatest back down to something less recent.
So I did both of these, changing the deployment targets from iOS 14.5 and macOS 11.3 to iOS 14.1 and macOS 11.0.
This has resolved (or worked around!) the issue.
I do want to deploy to the latest and greatest target for this particular app, so I don't consider it to be a complete solution as yet, but it will do as a work around for now. (I actually want to deploy to 15.0 when it's available to make use of the promised improvements to OSLogStore.)
So this sounds like a bug to me, and I have queried Apple for some further information on the issue, in particular, the ability to target more recent OS versions.

Custom Siri Intent Generation broken in Xcode Version 11.4 (11E146)

I updated Xcode yesterday only to discover that my custom siri intents no longer seem to generate. I started seeing others with this issue on the Apple dev forum this morning https://forums.developer.apple.com/thread/130691 and thought I would ask here if anyone found a solution for this. When I visit build settings, there no longer seems to be a setting to select the intent generation language with the "intent class generation language". Target membership on the intent is good and again, this built yesterday before updating and has not been altered for months. Does anyone know if rewriting all the custom intents will fix this (that's what I am going to try next) or if there is some new setting / plist entry that needs to be updated to get this working again. I will update here if I find the solution. Also to note, I was generating my intent files in Objective C.
I have dug around, and also talked to Apple Support. Turns out, it has to do with the "legacy build system".
Once i switched to the new build system in xcode project settings, i could build the project again.
You could argue that it should work if they still support the legacy system (which they do), but oh well.
Read how to switch here:
https://help.apple.com/xcode/mac/current/#/dev396bc94c7

XCode Project Invalid Bundle on App Store Upload

When submitting our app to the app store the validation process for the build keeps getting rejected with the following error.
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
Has anyone else had issues with this error? I feel like I've tried just about everything. I'd done the suggested otool -L on the main app as well as the watch app. The only library that it shows linked for is the Mixpanel library. The only other two libraries we are using is Fabric and Crashlytics. From my understanding those are not actual real frameworks? I've also tried to set ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to YES as many posts online suggest. The project builds and runs fine so I'm completely lost as to how to resolve this issue.
This is a React Native iOS app if that has anything to do with it. I'm not the most experience when it comes to iOS stuff but I can find my way around xcode. Anyone have any suggestions? Maybe the best solution is to just create a new xcode project and set everything up again and copy/paste in the code from the previous project?

Can't run Lister app sample code (Swift) from Apple's website

I tried to download and run the Lister app sample code which was presented at WWDC for the session 406: Integrating Swift With Objective-C. (I am running XCode 6.1 on Yosemite and this is the most updated version of the Lister app from the sample code page in Apple).
https://developer.apple.com/library/ios/samplecode/Lister/Introduction/Intro.html
However I was unable to run the app in XCode which are best show in the attached screenshot.
The app doesn't have the Run and Stop buttons enabled. They are greyed out. Never had this before for any other app.
The icons for the Lister app is not showing. Instead there is this new Settings-like icon which I have never seen and have no idea what it means.
There is a ReadMe.txt file in the project that you downloaded. Have you read it because I had the same problem and by reading it, my problems were solved.
Regards
The QuickStart guide included in the project gives the key setting to change in the Build Settings to enable iCloud.
In the User-Defined section, double-click on com.example.apple-
samplecode to edit the LISTER_BUNDLE_PREFIX value.
Change this prefix to a globally unique reverse DNS string for your own
organization’s name, such as com.somecompany.lister.

Supported Platforms for iPad app?

I'm creating an app for iPad (my first), and I was about to submit a binary until I noticed something peculiar in the target build settings. Under the "Supported Platforms" key, it say "iphonesimulator iphoneos". Additionally, it says "build/appname.build/AppStore-iphoneos" under Per-configuration Intermediate Build File Paths. However, the app is supposed to be built for iPad. In the summary, the iOS Application Target Devices specifies "iPad". Note that I originally created the app to be universal, but would now only like to release it as an iPad app.
SOLVED: A note to anyone who might have the same question. I did not initially change the Build Variants from "iphonesimulator iphoneos", but I ultimately had to because I had a code sign problem, in which the Build Variants must be set to "normal" in order to compile. See this post for further info, it helped me:
Code Sign Failed - Exit Code: 1
Is this a question? Once you submit to the store, you'll mark the app as being available for iPad only.
The SUPPORTED_PLATFORMS conditional is meant for libraries that can be compiled for both MacOS and iOS (a.k.a. iPhoneOS... there is no such thing as iPadOS). It can also be used for libraries that build to work on only the device (such as things that utilize hardware connectors) and not the simulator.
Hope this makes sense.

Resources