AeroPlus Flightplan file exchange specifications (iOS)

AeroPlus Flight Plan file exchangeĀ technical specifications

Our AeroPlus FlightPlan iOS app offers the possibility to exchange (export/import) flight plan withĀ other apps installed on the same iOS device or received by email. We are using the ICAO flight plan format described as a basis for our exchangeĀ file.

The approach taken with our app is the defaultĀ Open in… functionality implemented in iOS. Users can tap on anĀ Open in… button and receive the full list of appsĀ installedĀ on their device that can handle the specified file format. Also, if the file is sent from another app or web portal by e-mail to an iPhone user which has our flight plan app installed, a file with the specification can be imported into our flight plan app.
In order to receive the file in your iOS app there are 2 steps that must be followed:
  • Fill your info.plist file with information that will tell iOS that you are capable of handling the .icaofpl format.
  • Handle the file itself in your app delegate with just a few lines of code.
1.Ā Please add this in your info.plist file of your target. Using this, your app will register to receive files with .icaofpl format and thus automatically appear in our app, in the list of apps that can handle the specified file format.
    <key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeMIMETypes</key>
			<array>
				<string>application/icaofpl</string>
			</array>
			<key>CFBundleTypeName</key>
			<string>Icao FPL</string>
			<key>LSHandlerRank</key>
			<string>Owner</string>
			<key>LSItemContentTypes</key>
			<array>
				<string>com.icaofpl</string>
			</array>
		</dict>
	</array>
	<key>UTExportedTypeDeclarations</key>
	<array>
		<dict>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.text</string>
			</array>
			<key>UTTypeDescription</key>
			<string>Icao FPL format</string>
			<key>UTTypeIdentifier</key>
			<string>com.icaofpl</string>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<string>icaofpl</string>
				<key>public.mime-type</key>
				<string>application/icaofpl</string>
			</dict>
		</dict>
	</array>

2. Please implement in your app delegate the method:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation

This method gets called if your application is already opened in the background. In case the app will start at that very moment, the file URL will be provided in theĀ launchOptionsĀ parameter of your launching method:

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Use theĀ launchOptionsĀ to retrieve the URL of the file being transferred. For example, a simple call to the previous method, like this, would be enough:

    [self application:application
              openURL:[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey]
    sourceApplication:[launchOptions valueForKey:UIApplicationLaunchOptionsSourceApplicationKey]
           annotation:nil];

The URL specified is the URL to the file being transferred. To retrieve the content of the file as an NSString just use this line:

    NSString *fplMessage = [NSString stringWithContentsOfURL:url
                                                    encoding:NSUTF8StringEncoding
                                                       error:nil];

A sample output file for an IFR flight from Rotterdam (EHRD) to Antwerp (EBAW) at an altitude of 2000 feet with one waypoint in the route (WOODY) with a level change to 1000 feet is found below:

(FPL-PHTEST-IG
-SR22/L-SBDGRY/S
-EHRD1145
-N0165A020 WOODY/N0165A010
-EBAW0035  
-PBN/B2C2D2O2S1 NAV/GNSS GBAS DOF/130828 RMK/PIC PHONE 0123 456789 FILED USING AEROPLUS
-E/0100 P/1 A/ C/PILOT)

For more details, read the Apple specificationsĀ or contact us.Ā