I am currently building an iOS application using Xamarin and was looking to implement a settings bundle so that our QA department can point the app to the appropriate API environment.
What I am looking at doing is including or excluding the Settings bundle in the Xamarin iOS app based on the build configuration as I may not want to expose this data to the user in Release mode.
Can you include or exclude the Settings bundle or even change the bundle that is compiled into the app based on the build configuration?
(I gotten asked this so many times :-) , I figured I would expand my original answer.)
So as an example, in Debug
mode, I want to include a Setting.bundle
that consists of Root.plist
and a submenu Extra.plist
.
In Release
mode, I want to include a totally different Root.plist
and no Extra.plist
in the app's Setting.bundle
.csproj
file is going to look like this: <ItemGroup Condition="'$(Configuration)'!='Debug'">
<BundleResource Include="Settings.bundle\Root.plist" >
</BundleResource>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<BundleResource Include="Settings.debug\Extra.plist" >
<Link>Settings.bundle\Extra.plist</Link>
</BundleResource>
<BundleResource Include="Settings.debug\Root.plist" >
<Link>Settings.bundle\Root.plist</Link>
</BundleResource>
</ItemGroup>
As shown below, in Debug
Xamarin is including additional menu items into my Root.plist and in Release
they are not. Also my Additional Settings
submenu is no longer available and now are labeled with XXXX Release
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With