Xamarin forms white-labeled app (multi branded) - visual-studio

I am building an Xamarin Forms IOS, Android and UWP app that can be custom branded for different clients (e.g. white-labeled). Their apps are exactly the same except for Info.plist, bundle identifier, name, app icons, assets and a few other minor things.
Personally, I thought of a project with multiple build configurations. (pre-build event scripts)
Does anyone know how I can realize this step by step(try it out)?

As i see it, You could have a main set of projects (shared, platfrom-dependent, controls etc) with a skin system implemented - this is your app with all the functionality, let's call it "A".
Then You would have different VS solutions for each brand with projects "A" + "B - the launcher shared project for a specific brand, with appropriate bundle id etc".

Related

Is it possible to use asset catalog from an iOS class library in a Xamarin Forms iOS app?

Could not find any answers to this specific problem anywhere online.
I've had to factor a Xamarin forms project as there was a requirement to have multiple android/iOS apps that use the same code. Current set up is:
Standard Library
Android App 1
Android App 2
iOS App 1
iOS App 2
Android Class Library
iOS Class Library
For android, the images are in the resources folder in the android class library and the images display fine in the app.
For iOS I have put the images in a Asset Catalog in the iOS class library. These however, do not show in the app. I created an asset catalog in one of the iOS app projects and tested that an image would load from there - and it did. Is it not possible for images to load from an asset catalog in a iOS class library? I have other items in the iOS class library (such as custom renderers, which work fine). If the latter is not possible, is there a different way I keep the images in one place for iOS, without having to change my xaml? This is an existing project, with loads of images already being referenced by name in xaml (e.g. Source="image.png") that are used for both iOS and android. If possible, I don't want to have to maintain an asset catalog per app, although I do know of a way it could be automated, but I want to avoid having to do that if possible.
Using .NET Standard 2.1 and Xamarin Forms 5.0.0.2401
Thanks in advance.

How do I specify an App groups in the nativescript application (for iOS)

I'm developing an application with Share Extension in nativescript.
The Share Extension is developed using XCode and has an App Groups specified.
How do I specify an App Groups on the main application without the need to enter the XCode every build?

Appcelerator App Conversion iOS to Android.

One of our developer developed an app in appcelerator using alloy framework for iOS which works fine. Now we want to run the same app in Android, since the appcelerator is a cross platform tool, we wish to make the Android version of the App. I tried searching about it and explored the applcelerator ide for options but couldn't find it. Can some one please guide me into the right direction?
First of all have a look at this link : http://docs.appcelerator.com/platform/latest/#!/guide/Supporting_Multiple_Platforms_in_a_Single_Codebase this will guide you to update the application for multiple platforms.
Their are basically two different ways to port any application from android to iOS or vise-versa, but before that just let me clear one more thing to you about tiapp.xml.
In the tiapp.xml of your project you need to updated the Development Target by checking for which platform you are developing the application for (iPhone, iPad, android, Mobile Web).
Option 1 :
Cross Platform is build to make code re-usable (i.e. re-use same code for all the platforms), but we have exceptions with many things. Their are lot of components that work fine in iOS but when you use them in android then you will face errors. So in that case you just need to apply conditions for android and iOS like below :
if(OS_ANDROID)
// do something
else if(OS_IOS)
// do something
What you need to do is that you need run the application in android simulator and test the application for these changes and then apply the changes accordingly.
Basically a developer has to target the UI for both the platforms, as their will not be any logical differences between the two. Also their will be UI changes between the same components, like for example a picker in iOS will not look the same as it will when you look it in an android application.
Option 2 :
Now in the project you have assets folder with the platform that you have selected in the tiapp.xml (i.e. iPhone, android etc).
You can create similar structure in the style and view folder, create two folders iOS and android in both the directory (i.e. style and view).
First, move .tss of style folder (except app.tss and index.tss) in the iOS folder, then copy the files in the android folder also.
Repeat the similar process with the View folder also.
Now you have two different structures (i.e. view and styles) according to their platform. Now you can run the application in android simulators and resolve the error that you face.
Hope this small information helps the cause, you can also have look at the documentation of all the components from below link :
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView

Why does Xcode create two targets for watch app?

I'm new to WatchKit and I want to develop a Watch extension for my existing iOS app. I did develop a Share Extension before in the same project, so I know a bit about how extension targets are embedded into the app.
However, when I added a Watch app target using default settings, it created two targets, Watch and Watch Extension. I have trouble understanding the purpose of having both. Watch appears to have non-model content (e.g. assets, storyboard) by default and Watch Extension appears to have my actual code (e.g. interface controllers). Why aren't they together by default? What is the purpose of splitting them, as they will both run together on the Watch?
When the Apple Watch first came out, the "Extension", ran on the phone and the "App", which contained the UI, ran on the watch. With the release of Watch OS 2, both run natively on the watch, but the targets continue to be separated. Hopefully soon we'll be able to have one target
While I can't say that they'd always need to be separate targets in terms of build dependencies, they do need to be distinct in terms of packaging, because the app and extension aren't always run together.
Similar to iOS, the .watchkitapp.watchkitextension bundle is a distinct component of the .watchkitapp package. Although the watch app does require the app extension, it's possible for an app extension to run in the background without its app having been launched. The watch might even be showing a completely different app in the foreground.
As an example, if an app extension included a complication which was shown on the watch face, that extension would receive a request from ClockKit to wake up. Its complication controller gets instantiated (based on information in the extension's property list) to update the complication server. This would all happen independent of the watch app. The watch app itself wouldn't be launched, unless the user happened to tap on that particular watch face complication.

How do I exclude an IOS 8 app extension from a build?

I am building two versions of my app from the same code base, one for IOS 7/8 and one that is IOS 8 only. I would like to exclude the extension from the 7/8 applications but include it in the IOS 8 version. I've looked in the info.plist, the build phases and the schemes for the apps and the extension and have found no references to either.
I'm sure I'm missing something simple. Any hints?
I've looked in the info.plist, the build phases and the schemes for the apps and the extension and have found no references to either.
Look again? The setting that controls whether an app includes an extension is in the build phases for the app. By default it's called "Embed App Extensions", but you can rename it to whatever you like.
Select the extension(s) and click the "-" button at the bottom.
You probably also want to remove the extension from the target dependencies for the 7/8 app.

Resources