Update the Connect library to a newer version
To update the Connect library integrated into your app, follow instructions for your development platform.
- Open the app-level build.gradle file.
- In the
dependencies
section, update the version number for the Connect plugin.
dependencies {
implementation "io.github.go-acoustic:connect:10.4.14"
}
- Clean and rebuild your project.
If you use the plus sign instead of a version number, it prompts Gradle to install a new version as soon as it is made available. This can be a stable or a beta version.
dependencies {
implementation "io.github.go-acoustic:connect:+"
}
You can use either of the following approaches to updating the Connect plugin in your Flutter app:
- Strict approach when you specify the exact version to install
- Flexible approach when you allow automatic updates within certain constraints.
When you enter the caret symbol ^ next to a version number, it signals that you allow minor updates and patches within the same major version, for example from version 2.33.0 to version 2.33.1 or 2.35.0. When a new major version is available (3.x.x), you will need to update the dependency.
Note
While minor versions aim for compatibility, there's always a slight risk of unexpected issues. It's a good practice to test your app thoroughly after updating packages.
Instructions
- In the root project directory, open pubspec.yaml.
- Specify a version number or constraint.
dependencies
connect_flutter_plugin ^2.33.0
- From the root project directory, run the
update
command.
flutter pub update
Flutter will look for the latest versions of your dependencies that fit the specified version constraints.
Additional version-related settings
There is a configuration file in the Connect library (ConnectConfig.json). It lets you manage some additional settings related to versions:
- Upgrade (or downgrade) to a custom version of the iOS or Android library.
- Change the build type from beta to release or vice versa.
Here are the detailed descriptions of these optional configuration parameters:
Parameter | Values | Description |
---|---|---|
useRelease | Boolean. The default value is true . | Set the value to false to switch to the latest beta version of the library. It contains debug information. |
iOSVersion | String | Under the hood, the Connect Flutter SDK is a wrapper for two Connect SDKs: iOS and Android. Using this parameter, you can downgrade the iOS SDK to an older version. |
AndroidVersion | String | Using this parameter, you can downgrade the Android SDK to an older version. |
After editing ConnectConfig.json, you must run the Connect Command Line Tool. This is necessary to apply the changes.
cd <YOUR_PROJECT_PATH>
dart run $HOME/connect_cli/bin/connect_cli.dart
CocoaPods
If you added the Connect library using the CocoaPods dependency manager, navigate to the root project directory and update the pods. Here is an example for the debug version.
pod update AcousticConnectDebug
If you have the release version, replace AcousticConnectDebug
with AcousticConnect
.
Carthage
If you added the Connect library using the Carthage dependency manager, navigate to the root project directory and run the carthage update
command.
Swift Package
If you added the Connect library as a Swift Package, you can update it in the following way:
- Under Package Dependencies, right-click (or Control-click) on the Connect package.
- Select Update Package from the context menu.
You can manage version preferences for the Connect library in the package settings.
The way you update the Connect JavaScript plugin depends on where the core library is hosted. If in doubt, check the scr
attribute in the JavaScript snippet.
- If the library is hosted in our CDN, you needn't do anything (recommended). The core library is always up-to-date.
<script src="https://cdn.goacoustic.com/connect/latest/acoconnect.js"></script>
<script>
window.ACOCONNECT && window.ACOCONNECT.initLib("YOUR APP ID", "YOUR COLLECTOR POST URL");
</script>
- If the core library is hosted on your server, then you are responsible for updating it.
To update the core library, do the following:
- Download an installation archive from our GitHub repository.
- Copy the core library.
- Open the custom JavaScript file on your web server and replace the core library section with the newer one.
// custom .js file structure
<pako library, minified> // don't edit
<core library, minified> // don't edit
<configuration> // for editing
Updated 3 days ago