iOS Question How do i set different icons for different configurations?

ema01

Member
Licensed User
Hi,
i am in the process of developing an app that will be distributed in two versions.
One of our clients wants it customized and the only differences will be cosmetic (splash screen, logo and contacts) so i'd like to just use two different configurations.

It was easy to do in B4A (i'm using adaptive icons, each configuration has its own #AdditionalRes included) but i have no clue wether it's possible in B4i.
So, is it possible? How do i do that?

And by the way, is there a way to build all configurations at once? Not necessarely through the IDE
 

Erel

Administrator
Staff member
Licensed User
Untested:
B4X:
#If FULL
#CustomBuildAction: folders ready, c:\windows\system32\cmd.exe, /c copy ..\full_icon.png ..\Files\Special\icon-store-1024.png
#Else
#CustomBuildAction: folders ready, c:\windows\system32\cmd.exe, /c copy ..\not_full_icon.png ..\Files\Special\icon-store-1024.png
#End If
#CustomBuildAction default folder is the Objects folder, this means that the above commands expect the icon to be in the project folder.
 

Semen Matusovskiy

Well-Known Member
Licensed User
Different cinfigurations mean different IPA. For me it's not a good idea. Why do not include all files and to select in run time ? It's possible even to change app icon on fly (since IOS 10.3)
 

ema01

Member
Licensed User
Well, the idea is to have in fact two different applications, with two different package names and two different store pages so different IPA doesn't sound like a bad idea, unless i'm missing something.

Using conditional compilation would let have just one project to mantain
 

ema01

Member
Licensed User
Anyway, i tried and i have to copy all icons so i put them all with the appropriate names in a dedicated folder and added the following

B4X:
#if PACKAGEA
#CustomBuildAction: folders ready, c:\windows\system32\cmd.exe, /c xcopy ..\Files\iconsA\ ..\Files\Special\ /Y
#else
#CustomBuildAction: folders ready, c:\windows\system32\cmd.exe, /c xcopy ..\Files\iconsB\ ..\Files\Special\ /Y
#end if
I used xcopy so i could copy everything instead of having multiple custom actions. seems to be working!
 

MrKim

Well-Known Member
Licensed User
This is working for me:
B4X:
'copy our appropriate icon files and DB
#IF B4A OR B4J
    #iF App1
       #CustomBuildAction: 1, %WINDIR%\system32\robocopy.exe, "..\..\Icons\usedapp1" "..\icon" /MIR
       #CustomBuildAction: 1, %WINDIR%\system32\xcopy.exe, "..\..\Icons\app1aboutlogo.jpg" "..\files" /q /y
    #ELSE 'App2
       #CustomBuildAction: 1, %WINDIR%\system32\robocopy.exe, ..\..\Icons\usedapp2 ..\icon /MIR
       #CustomBuildAction: 1, %WINDIR%\system32\xcopy.exe, "..\..\Icons\app2aboutlogo.jpg" "..\files" /q /y
    #END IF
    #iF Production  'Copy the Empty DB
       #CustomBuildAction: 1, %WINDIR%\system32\cmd.exe, /c copy "..\..\Shared Files\persons.db" "..\Files\persons.db"       
    #END IF   
#Else IF B4i
    #iF App1
       #CustomBuildAction: 1, %WINDIR%\system32\cmd.exe, /c copy ..\..\Icons\AlanonLogo1024x1024.png ..\Files\Special\icon-store-1024.png
       #CustomBuildAction: 1, %WINDIR%\system32\xcopy.exe, "..\..\Icons\app1aboutlogo.jpg" "..\files" /q /y
    #ELSE 'App2
       #CustomBuildAction: 1, %WINDIR%\system32\cmd.exe, /c copy ..\..\Icons\app2Logo1024x1024.png ..\Files\Special\icon-store-1024.png
       #CustomBuildAction: 1, %WINDIR%\system32\xcopy.exe, "..\..\Icons\app2aboutlogo.jpg" "..\files" /q /y
    #END IF
    #iF Production  'Copy the Empty DB
       #CustomBuildAction: 1, %WINDIR%\system32\cmd.exe, /c copy "..\..\Shared Files\persons.db" "..\Files\persons.db"       
    #END IF   
#END IF
Watch your caps. I will NEVER get used to case sensitive filenames.:mad:
2 apps on 3 platforms the only difference between the two apps is appearance, name, and the DB they connect to on the cloud is different,
I use 4 build configurations. One 2 for each app - 1 for debug and 1 for production.
 
Top