How can I configure my iPhone project to use a seperate application icon for beta releases - iphone

What I am trying to achieve is for the application icon to be different in builds that I send out to my beta testers, to that of the application that will be submitted for approval. This will allow me and my beta testers to easily identify the app is a beta version.
I was not sure if I should be adding a build script to modify the info.plist and change the application icon specified there. For this I guess I would have to conditional check the build type (DEBUG/RELEASE/DISTRIBUTION etc) and write the appropriate value to the plist file.
Alternatively I thought I might need to create a separate target for beta releases and specify the new BETA application icon there.
If anyone has done this kind of procedure before, any tips and ideas about how best to do it would be very much appreciated.

Outdated: As of September 2017, my answer is probably outdated now. Please use latest Apple developer guides relating to Asset Catalogs. Asset Catalogs are the new way of specifying image/icon resources for your app.
Original answer:
Both ways you have mentioned can be used for this purpose (Through a separate Target or using Build settings). In my opinion, the more logical way would be to use a different build configuration and set the plist file to dynamically get the icon file name from the build configuration.
Here is how I would do it:
In project build settings, create a new user-defined variable called ICON_FILE (for "All Configurations")
Set the value of the variable to "Icon.png" (for "All Configurations")
Create a new build Configuration called "Beta".
Set the value of the ICON_FILE variable to "Icon-beta.png" for "Beta" configuration.
(this will make all the configurations have the value "Icon.png" except Beta config)
In the Info.plist set the value of "Icon file" attribute to ${ICON_FILE}. This will make the info.plist dynamically get the filename from the variable you defined earlier.
In your application resources, include the beta icon with the name "Icon-beta.png" in addition to "Icon.png" you already have.
If you build the app using "Beta" config, the app will have the beta icon as the app icon.
Hope this helps!

Asset catalogs can be used without creating another target.
Here are the steps I use:
1 - Create two (or more) app icon set in images.xcassets
2 - Create another configuration from project settings
3 - Go to Target -> Build Settings and search for app icon.
You will see Asset Catalog App Icon Set Name under Asset Catalog Compiler - Options. Change the asset catalog name that will be used in new configuration.
4 - Build for different configurations.

The accepted answer is not working for xcassets.
So, if you already started to use xcassets catalog here is the steps:
You need to create 2 different targets of your application.
To do this:
Right click on your target. -> Click Duplicate (or Cmd+D)
Set name of new target like MyApp-beta
Create separate icon:
Go to your xcasset catalog.
Right click on column with list of images -> click New App Icon
Name it like icon-beta, add place here your beta icons
Click on your beta-target
Go to tab General -> App Icons -> select your asset icon-beta
Here it is. Now you can build your beta application!
Another advantage of this method over that described in the accepted answer - is that you can install both versions at the same time of your Application. (you need to set different Bundle Identifier for this).

Related

Receive share file intents with Flutter with IOS

I'm using the following plugin
https://pub.dev/packages/receive_sharing_intent
It is working with android.
But the instruction for IOS are unclear - I follow the IOS instruction and I'm able to share files with my app, when I do so, my app opens but the flutter code is not executed, the only thing I see in the log is:
6.26.0 - [Firebase/Analytics][I-ACS023000] Deep Link Web URL query is empty
Which doesn't mean any thing to me.
I tried to look for this error and couldn't find anything that is related to sharing intent.
Can someone clarify this?
Is there a tutorial on how to set sharing intent for IOS?
In the instruction it says:
ios/Runner/Runner.entitlements
....
<!--TODO: Add this tag, if you want support opening urls into your app-->
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:example.com</string>
</array>
But I don't have such file in my directory structure, any idea how to set it correctly?
....
EDIT:
I created and added the file ios/Runner/Runner.entitlements manually
I noticed I missed the last step (after publishing the question), so I did it:
Add Runner and Share Extension in the same group
Go to the Capabilities tab and switch on the App Groups switch for both targets. Add a new group and name it group.YOUR_HOST_APP_BUNDLE_IDENTIFIER in my case group.com.kasem.sharing
This step is not very clear:
the name of the tab is Signing & Capabilities
in order to switch on the App Group you should click on `+ Capability' in the top left of the tab
I checked the checkbox next to App Group
Add a new group and name it group.YOUR_HOST_APP_BUNDLE_IDENTIFIER in my case group.com.kasem.sharing
After this I was able to receive the file intent in the App but couldn't open the file:
print("$path, exist ${await io.File(path).exists()}");
I was able to print the path but the exists method return false
NOTE:
works with no issues in android
works with no issues in IOS when sharing an image
only fails with files (PDF)

Flutter - how to create a framework where i can have Debug and Prod versions where debug version has some way to choose test environment

I need to create two different versions of the app.
- debug
-prod
for debug, version i need user to select the test environment before anything else begins. i need some way to know what environment user has selected and then load API endpoints config file accordingly.
what's the best way to handle this in flutter?
I have seen in some apps that for iOS, debug options are available in app settings under the standard iOS settings menu , select the app and then see those options in there.
You might want to use Flutter Flavours. As the name suggests, you can practically make flavours of the same app based on your need - debug, test, production etc. And not only API end-points, but you can also configure everything else such as app icon, different labels on the screen etc.
As suggested in this link, you can have different main.dart file for each flavour. You can read different configuration from JSON file (such as API end-point) and rest of your app will remain same. For example, see below :
This is another helpful link.

Bundle Identifier Changed Core Data Lost

I changed a project from Objective-C to Swift and created a whole new project when I did this. I have an app in the AppStore and wanted to send an update instead of releasing a new app.
I understand that my Bundle Identifier needs to be the same when updating an app. When preparing the app for release, I changed my Bundle Identifier to match my app in the AppStore - since I started with a new project - and in the process my Core Data file seems to be missing. If I change my Bundle Identifier how do I keep access to Core Data?
This took me a while to figure out but here is how I fixed the issue.
Change your product name under Build Settings -> Packaging -> Product Name to the desired product name. This will change you Bundle Identifier to the desired name.
Clean your project by selecting Product -> Clean.
Select your CoreData model in the project navigator and then select the "Data Model Inspector" in the Inspector tab. Change the project name under class to the new class name. I got stuck here since I did not know Spaces, dashes, . are all replaced by underscores. You can see that my Product Name is FLO-Cycling and the CoreData class is FLO_Cycling.
If you have imported the Swift bridging header file anywhere make sure to update it.
I hope this can help someone.
Take care,
Jon

Getting error in app porting

I am porting an app from HVGA (Bada 2.0.2 device ) to WVGA( Bada 1.2) using ecllipse( version 2.0.2 ).
For this I have done the following changes in my project
Project-> Properties/Bada build
Set Model WVGA and set AutoScaling true(480x800)
I have create a form of Resolution 480x800.
For images I have add a folder in Resouce folder
-> 480x800
->ScreenDensity-High
and place all my resources in these folder .
But my app crashes when I click the button in the app to Select more images as requirement in my app and the log show Output as Shown
Info, Installation completed.
0080.772,EXCEPTION,P32,T00,A125,Osp::Media::__Image::HasAlphaChannels (1547) > [E_UNSUPPORTED_FORMAT]
0080.774,EXCEPTION,P32,T00,A125,Osp::Media::Image::HasAlphaChannels (599) > [E_UNSUPPORTED_FORMAT] Propagated.
0080.851,EXCEPTION,P32,T00,A125,Osp::Media::__Image::HasAlphaChannels (1547) > [E_UNSUPPORTED_FORMAT]
0080.851,EXCEPTION,P32,T00,A125,Osp::Media::Image::HasAlphaChannels (599) > [E_UNSUPPORTED_FORMAT] Propagated.
I had check for this in the Bada Help but unable to find solution.Please give your suggestion to solve this problem
As I see you just moved your Images (optimized for HVGA) to a new folder to use them for WVGA.
If I understand it correctly, I suggest that you with the reference of bada development documentation in your SDK (through bada IDE help system) which specifies that what is the specific images properties for WVGA screens, change your images properties to a compatible ones (re-size them) and rebuild your project.
I think the problem will solve , we like your feedback.
best regards.
I find the reference for you mate: Using Customized and Optimized Resources

one code base for iphone generic application?

I have built a generic application which can handle different content data - but for each content data, it will be a different iphone application (with a different name).
I would like of couse to only keep one code base for all these different apps (as it would be easier maintenance) but I have 2 questions:
1- I would need to change the appname in the buildsettings, etc.. and may be it is going to be an overkill...? especially with the upload process then...? What are your experiences in that domain and what would you recommend me to do?
2- how can I have all the pictures for logo (Icon.png, etc...) to co-exist into one app? For the moment, I have a global variable (as a singleton pattern) that I switch to change appname and loaded data inside the program
Thanks in advance for your help
Cheers,
geebee
You can do this pretty easily, it's what most developers do in their lite versions. All you have to do is add another target to create a new app out of the same code and use that global variable.
In order to change the images included in the app you simply edit the target and under the copy bundle resources menu remove the unnecessary resources. You'll notice that when you add a new resource you have the option to include it in any one or more of your targets. Simply select the one that you want and it will only be accessible to that target.
The reason that this works is that each target can have its very own info.plist. All the settings and resources can be separate, and the code can be different using your #ifdef global_var.
Here's a slightly outdated tutorial that should get you started if you need it.
http://www.bit-101.com/blog/?p=2098
For each application name add one target.
Create one xyz-info.plist for each of the target. (in this case for the xyz.app)
In each of the xyz-info.plist assign the appropriate icon files etc.
Within your build phases for each of the targets you will define which images go with which app.