Apple Application Info: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Create page "iOS Application Info")
 
(Gather iOS pages into a category)
Line 1: Line 1:
[[Category:iOS]]
== General ==
== General ==
The most of information you could get from Info.plist. This file you could use to configuration your application. In this file you could set icon and splash screen, add file sharing, custom URL protocol etc. For more information about this file you could find in official documentation [https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html#//apple_ref/doc/uid/TP40009254-SW4 here].
The most of information you could get from Info.plist. This file you could use to configuration your application. In this file you could set icon and splash screen, add file sharing, custom URL protocol etc. For more information about this file you could find in official documentation [https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html#//apple_ref/doc/uid/TP40009254-SW4 here].

Revision as of 16:00, 25 November 2016

General

The most of information you could get from Info.plist. This file you could use to configuration your application. In this file you could set icon and splash screen, add file sharing, custom URL protocol etc. For more information about this file you could find in official documentation here.

If you want to print all fields from Info.plist you could use something like this:

NSLog(@"Info.plist content: %@", [[NSBundle mainBundle] infoDictionary]);

Also you can add custom fields to Info.plist and get access to it with key name which you set for example:

//Get value of property with name 'custom_key'
QString str = QString::fromNSString([[[NSBundle mainBundle] infoDictionary] objectForKey:@"custom_key"]);


Application Short Version

QString str = QString::fromNSString([[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]);

SDK Build

QString str = QString::fromNSString([[[NSBundle mainBundle] infoDictionary] objectForKey:@"DTSDKBuild"]);

Xcode information

QString str = QString::fromNSString([[[NSBundle mainBundle] infoDictionary] objectForKey:@"DTXcode"]);
QString xcodeBuild = QString::fromNSString([[[NSBundle mainBundle] infoDictionary] objectForKey:@"DTXcodeBuild"]);

Minimum OS Version

The minimum version of iOS when your application can be installed.

QString str = QString::fromNSString([[[NSBundle mainBundle] infoDictionary] objectForKey:@"MinimumOSVersion"]);

Check Application In AppStore

This code you can use if you need to detect when application was installed to device from AppStore.

#if !TARGET_IPHONE_SIMULATOR
    if([[NSBundle mainBundle] pathForResource:@"embedded"
                                       ofType:@"mobileprovision"])
    {
        return false;
    }
    else
    {
        return true;
    }
#else
    return false;
#endif

File Sharing Enabled

If this flag is true your application supported upload file from iTunes.

bool flag = ([[[[NSBundle mainBundle] infoDictionary] objectForKey:@"UIFileSharingEnabled"] boolValue] == YES) ? true : false;

Supported Interface Orientations

List of supported interface orientations. This list can be different for iPad and iPhone.

NSArray* array = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"];
NSString* platformsString = [array componentsJoinedByString:@"|"];
QString str = QString::fromNSString(platformsString).split("|");