Knowband Blog | Ecommerce Modules

How to Configure Your Flutter Apps for iOS 16 (Xcode 14 Developer guide)!!

As mobile technology keeps evolving, it is important for developers to keep up with the changes and make necessary modifications in their code to ensure compatibility with the latest versions of operating systems and software. Likewise, both Apple and Android launch various configuration changes with each update. For example, Apple recently made some modifications in the Flutter app configuration for the Flutter app developers. Following the same, now, the Flutter app development requires the below-mentioned changes in their codebase for ensuring compatibility with the latest Apple updates.

Thus, in this article, we will discuss the changes required for iOS 16 and Xcode 14 compatibility.

Common Changes for both iOS and Android

  1. Change the Package Version: The first step is to change the package version in the “pubspec.yaml” file. This file contains the metadata and dependencies required for the Flutter project. It is important to keep this file updated to ensure compatibility with the latest versions of the dependencies.
  2. Add Dependency Overrides: To ensure compatibility with the latest version of Firebase Core Platform Interface, you need to add a dependency override in the “pubspec.yaml” file. Add the following code in the “dependency_overrides” section: dependency_overrides: firebase_core_platform_interface: 4.5.1
  3. Modify the Device ID Method: To get the Android device ID, we use the method “build.androidId ?? ”” in the function “getDeviceID()” which is defined in the file “lib/common_files/common_methods.dart”. However, this method has been deprecated in the latest version. Instead, use the following method to get the device ID: build.id
  4. Replace “onDissmissCallback”: In the “AwesomeDialog()” widget, replace the “onDissmissCallback” with “onDismissCallback”.
  5. Remove Unused Packages: Remove the following lines from the file “lib/generated_plugin_registrant.dart” as they are of no use:

import ‘package:device_info_plus_web/device_info_plus_web.dart’;

import ‘package:file_picker/_internal/file_picker_web.dart’;

DeviceInfoPlusPlugin.registerWith(registrar);

FilePickerWeb.registerWith(registrar);

  1. Use Fingerprint/Face Login Functionality: On the signup and login page, use all the available parameters to detect and use the Fingerprint/Face login functionality. The available parameters are iris, fingerprint, face, strong, weak.
  1. Authenticate Fingerprint Login: Use the following code to authenticate the Fingerprint login:

options: const AuthenticationOptions(

useErrorDialogs: true,
stickyAuth: true,
biometricOnly: true

);

iOS-Specific Changes

  1. Change Minimum Deployment Target: In the Runner –> General Settings, change the minimum deployment target to 11.0.
  2. Change Minimum Deployment Target of Pods:

In the file “ios\Podfile”, change the minimum deployment target of Pods

from platform :ios, ‘10.0’

to platform :ios, ‘11.0’.

Android-Specific Changes

  1. Compare the “android/app/build.gradle” file with the attached “build.gradle” file.
  2. Add Line in “gradle.properties”: Add the following line in the file “android/gradle.properties“:

android.jetifier.blacklist=bcprov-jdk15on

  1. Modify “gradle-wrapper.properties”: In the file “android\gradle\wrapper\gradle-wrapper.properties“, change the distribution URL

from:

distributionUrl=https://services.gradle.org/distributions/gradle-6.7-all.zip

to:

distributionUrl=https://services.gradle.org/distributions/gradle-6.8-all.zip

After making the above changes, re-install the pods and run the app on the Simulator to ensure that the app is compatible with iOS 16 and Xcode 14. These changes are necessary to ensure that your app runs smoothly on the latest operating systems and software. By keeping up with the latest changes, you can provide a better user experience to your customers and stay ahead in the game.

In the End!

Knowband has accumulated over 10 years of valuable experience. In addition to our expertise in web development, we offer services for native and Flutter app development. If you have any questions or requirements related to Flutter app development, please don’t hesitate to reach out to us at support@knowband.com.