Set SceneDelegate in info.plist file - ios

I have an app target and a few static libs. Due to some reasons, I moved the SceneDelegate from the app target to one of the static libs.
In the info.plist file, the SceneDelegate is set as $(PRODUCT_MODULE_NAME).SceneDelegate (as shown below)
<dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
</dict>
</array>
</dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
</dict>
</dict>
This doesn't work now since SceneDelegate is not in the app target anymore. I tried TargetName.SceneDelegate but that just gives me the following error and the screen is black.
[SceneConfiguration] Encoded configuration for UIWindowSceneSessionRoleApplication contained a UISceneDelegate class named "(null)", but no class with that name could be found.
[SceneConfiguration] Info.plist configuration "(no name)" for UIWindowSceneSessionRoleApplication contained UISceneDelegateClassName key, but could not load class with name "TargetName.SceneDelegate".
This stackoverflow answer suggested to use $(SWIFT_MODULE_NAME).SceneDelegate but that didn't work because $(SWIFT_MODULE_NAME)'s default value is the app target i.e $(PRODUCT_MODULE_NAME).
Is there any other way of setting the SceneDelegate in info.plist file?
There's a dynamic way to set the SceneDelegate, using application(configureForConnecting:options) method of the AppDelegate, but the SceneDelegate may not be accessible in the target which has the AppDelegate (Yes, AppDelegate is also moved to a different target).
So, how else can I set the SceneDelegate in the info.plist file?

Related

canOpenURL: failed for URL: "instagram://" - error: "This app is not allowed to query for scheme instagram"

I've followed all guidelines by declaring the LSApplicationQueriesSchemes under Info.plist file but it return failed for those strings. I've no idea on it. Appreciate if someone could help it :)
<dict>
<key>NSBonjourServices</key>
<dict>
<key>0</key>
<string>_dartobservatory._tcp</string>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>facebook</string>
<string>whatsapp</string>
<string>twitter</string>
<string>instagram</string>
<string>instagram-stories</string>
<string>linkedin</string>
</array>
</dict>
</plist>
Errors:
Info.plist
Info.plist
While adding LSApplicationQueriesSchemes you need to edit Info.plist for all schemes. So you need to edit Info.plist, Info-Debug.plist and any other Info.plist if you have created any different scheme for iOS project.
As per documentation of appinio_social_share some applications support image for iOS and some applications don't support even if you provide it.

How the app icon is added inside my iOS app?

When I look my Info.plist their is nothing about icon in it, but after I deployed the app, I look in it for the the Info.plist and I can see that it's contain :
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon60x60</string>
</array>
<key>CFBundleIconName</key>
<string>AppIcon</string>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon60x60</string>
<string>AppIcon76x76</string>
</array>
<key>CFBundleIconName</key>
<string>AppIcon</string>
</dict>
</dict>
I can see that also the root folder of my app contain 2 files :
AppIcon60x60#2x.png
AppIcon76x76#2x~ipad.png
but nothing in my project, in deployment option, is speaking about those 2 icons. so where they are coming from ? what process add the CFBundleIconFiles key value to the info.plist ?
I want to specify myself the icon (and not from the ide of delphi, I want to update myself the info.plist, and i want to deploy myself the icon), how can I do ?
I only have a partial answer but hopefully will point you in the right direction.
The default info.plist.TemplateiOS.xml contains:
<%VersionInfoPListKeys%>
<%ExtraInfoPListKeys%>
<%StoryboardInfoPListKey%>
Each of these is expanded with information from your project settings. By deleting the corresponding key, you can replace it with your own settings. It might take some trial and error to determine which one inserts the icons.

Error "Invalid Intent Vocabulary" from App Store when trying to submit an app with Siri extension

My app is using a Siri extension with custom Siri intents, which is a new feature for Xcode 10 / iOS 12. I design my custom Siri intents in a .intentdefinition file (included for both app and extension targets).
My custom (not system) Siri intents are declared within the "Do" category.
A Siri intent also requires a AppIntentVocabulary.plist file with example phrases in it https://developer.apple.com/documentation/sirikit/registering_custom_vocabulary_with_sirikit
I've got my AppIntentVocabulary.plist included for the app target only. It 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>IntentPhrases</key>
<array>
<dict>
<key>IntentName</key>
<string>MyIntentName1</string>
<key>IntentExamples</key>
<array>
<string>Do stuff with foo</string>
<string>Do stuff with fu</string>
</array>
</dict>
<dict>
<key>IntentName</key>
<string>MyIntentName2</string>
<key>IntentExamples</key>
<array>
<string>Do other stuff</string>
</array>
</dict>
</array>
<key>ParameterVocabularies</key>
<array>
<dict>
<key>ParameterNames</key>
<array>
<string>MyIntentName1.someParam</string>
</array>
<key>ParameterVocabulary</key>
<array>
<dict>
<key>VocabularyItemIdentifier</key>
<string>paramName</string>
<key>VocabularyItemSynonyms</key>
<array>
<dict>
<key>VocabularyItemPhrase</key>
<string>foo</string>
<key>VocabularyItemPronunciation</key>
<string>fu</string>
<key>VocabularyItemExamples</key>
<array>
<string>Do stuff with foo</string>
</array>
</dict>
<dict>
<key>VocabularyItemPhrase</key>
<string>bar</string>
<key>VocabularyItemPronunciation</key>
<string>bur</string>
<key>VocabularyItemExamples</key>
<array>
<string>Do stuff with bar</string>
</array>
</dict>
</array>
</dict>
</array>
</dict>
</array>
</dict>
</plist>
It builds fine and works ok too. But when I'm trying to submit it to App Store, I get:
[Transporter Error Output]: ERROR ITMS-90624: "Invalid Intent
Vocabulary. The AppIntentVocabulary.plist file in the
Payload/AppName.app/en.lproj folder can't contain the intent name
"MyIntentName1"."
And there are subsequent error messages repeating for every .lproj folder.
If it helps, my app is localized for 14 languages, the project is not using base localization.
I had a similar issue when not using Base Localization. As stated from the Apple Docs:
Place your AppIntentVocabulary.plist file in the language-specific
(.lproj) directory of your iOS app that corresponds to your base
development language.
Not using Base localization can create this kind of problems especially with key names, as it needs a neutral name (using the same English wording works as well) to link against all the localized keys.
For the moment, you can only define custom vocabulary on a few specific types of intents: see here under "Register User-Specific Vocabulary" for a list, but it's things like ride sharing, notes, workouts etc. In other words, not your custom intents (that you might want to expose to iOS 12's Siri shortcuts - that's not available... yet).
And the docs say you need to specify one of those intents as the Intent name in the plist. Likewise, the parameter names need to be specific parameters of just those permitted intents. So I'm guessing that's why you're getting errors on uploading to the App Store - it's checking to see if Siri supports custom vocabulary for "MyIntentName1". Not sure why it's working locally for you, or why this isn't a check built into Xcode. 🤷‍♀️

How can an app’s icon change dynamically in iOS 10.3, like iOS's clock app? [duplicate]

I need to change the app icon based on region, is this possible?
Yes, this is possible since iOS 10.3.
First, you need to define all alternative icons in your Info.plist file, you can't fetch them dynamically.
In the example below we define 2 alternative icons: "de" and "fr":
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>de</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_de</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
<key>fr</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_fr</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_none</string>
</array>
</dict>
</dict>
Then you can set the icon name based on anything you like (game progress, weather conditions, premium user, etc.). To change the icon use:
UIApplication.shared.setAlternateIconName("de") { (error) in
if let error = error {
print("err: \(error)")
// icon probably wasn't defined in plist file, handle the error
}
}
Result:
The gif is from a Medium article by Julien Quéré.
This feature available in 10.3 (Beta)
Discussion
Use this method to change your app's icon to its primary icon or to one of its alternate icons. You can change the icon only if the value of the supportsAlternateIcons property is true.
You must declare your app's primary and alternate icons using the CFBundleIcons key of your app's Info.plist file. For information about how to configure alternate icons for your app, see the description of the CFBundleIcons key in Information Property List Key Reference.
Take a look at:
apple documentation

Is this possible to apply the alternative icon to the iOS application?

I need to change the app icon based on region, is this possible?
Yes, this is possible since iOS 10.3.
First, you need to define all alternative icons in your Info.plist file, you can't fetch them dynamically.
In the example below we define 2 alternative icons: "de" and "fr":
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>de</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_de</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
<key>fr</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_fr</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_none</string>
</array>
</dict>
</dict>
Then you can set the icon name based on anything you like (game progress, weather conditions, premium user, etc.). To change the icon use:
UIApplication.shared.setAlternateIconName("de") { (error) in
if let error = error {
print("err: \(error)")
// icon probably wasn't defined in plist file, handle the error
}
}
Result:
The gif is from a Medium article by Julien Quéré.
This feature available in 10.3 (Beta)
Discussion
Use this method to change your app's icon to its primary icon or to one of its alternate icons. You can change the icon only if the value of the supportsAlternateIcons property is true.
You must declare your app's primary and alternate icons using the CFBundleIcons key of your app's Info.plist file. For information about how to configure alternate icons for your app, see the description of the CFBundleIcons key in Information Property List Key Reference.
Take a look at:
apple documentation

Resources