Integrated solution with Speedchecker SDK for Capacitor applications
SpeedChecker Capacitor plugin allows developers to integrate speed test features into their own Capacitor apps. You can also try our apps on Google Play and App Store, they are powered by the latest SpeedChecker SDK versions. More information about SpeedChecker SDKs
- latency, download and upload speed of the user connection
- robust measuring of cellular, wireless and even local network
- testing details like the current speed and progress
- additional information like network type and location (see KPI list below in FAQ)
- included high-capacity servers provided and maintained by Speedchecker or custom servers
- detailed statistics and reports by Speedchecker
Android | iOS |
---|---|
supported ✔️ | supported ✔️ |
- minSdkVersion 22
- Location permissions (for free users)
- Xcode 13.3.1 or later
- Swift 5
- Development Target 11.0 or later
Free version of the plugin requires location permission to be able to perform a speed test. You need to handle location permission in your app level. When no location permission is given, the app will show a toast message with a warning, so you need to request both Foreground and Background location permissions in your app before starting the speed test. Check out our location policy
If you are a paid user, no location permission is required but you should set license key before you start test. Please contact us and we will provide you with licenseKey for your app.
Note: Make sure you have completed the Capacitor - Environment Setup instructions till "Create your Android and iOS projects" step, before proceeding.
npm init @capacitor/app
cd your-app-name
If you a paid user, you need to specify your appId, which is linked with your license, in capacitor.config.json, located in root folder of your capacitor app
{
"appId": "your_app_id",
"appName": "example",
"bundledWebRuntime": false,
"webDir": "dist",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
}
}
}
npx cap add ios
npx cap add android
npm install @speedchecker/capacitor-plugin
Speedchecker SDK uses custom Maven repository for android. You need to add this maven credentials to your project build.gradle file. This file is located here: your-capacitor-app/android/build.gradle
allprojects {
repositories {
google()
mavenCentral()
//add these repositories for free version
maven { url "https://jitpack.io" }
maven {
url 'https://maven.speedcheckerapi.com/artifactory/libs-demo'
credentials {
username = "demo"
password = "AP85qiz6wYEsCttWU2ZckEWSwJKuA6mSYcizEY"
}
}
//add these repositories for paid version
maven { url "https://jitpack.io" }
maven {
url 'https://maven.speedcheckerapi.com/artifactory/libs-release'
credentials {
username = "speedchecker"
password = "AP3Zg8iFoiatscExgkeMHP3ur9EcsNkbxC8e6gXr8QV9PeWtiAVM3pETm8pF"
}
}
}
}
if you have a license key, you can add it to Info.plist
:
<key>SpeedCheckerLicenseKey</key>
<string>your_ios_key</string>
WhenInUse location permission key is required if you are free SDK user. Add to Info.plist
:
<key>NSLocationWhenInUseUsageDescription</key>
<string>your custom text here</string>
Always location permission keys are required if you are using background tests. Add to Info.plist
:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>your custom text here</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>your custom text here</string>
If you want to use background tests, add following keys to Info.plist
:
Background modes key
<key>UIBackgroundModes</key>
<array>
<string>location</string>
<string>processing</string>
</array>
BGTaskSchedulerPermittedIdentifiers key
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.speedchecker.bgtests</string>
</array>
Additional background test setup keys
<key>SpeedCheckerBackgroundConfigURL</key>
<string>your background config URL</string>
You will also have to initialize background tests in AppDelegate
like this:
import SpeedcheckerCapacitorPlugin
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
SpeedChecker.initializeBackgroundTests(launchOptions: launchOptions)
return true
}
npx cap sync
npx cap run android
npx cap run ios
import { SpeedChecker} from '@speedchecker/capacitor-plugin'
if you have a license key, you can add your key as a String value in the app:
SpeedChecker.setAndroidLicenseKey({ key: '_your_android_key' });
License should be set before starting the test. Make sure your package name (for Android) or bundle id (for iOS) is the same as defined in your license agreement.
Plugin includes "startTest" function with listener "dataReceived", which you can listen to receive data from Speedchecker servers:
self.shadowRoot.querySelector('#startTestBtn').addEventListener('click', async function (e) {
try {
if (!isListenerAdded) {
const handle = SpeedChecker.addListener('dataReceived', (data) => {
const event = data.event;
const ping = data.ping;
const jitter = data.jitter;
const progress = data.progress;
const downloadSpeed = data.downloadSpeed;
const uploadSpeed = data.uploadSpeed;
const ip = data.ipAddress;
const isp = data.ispName;
const server = data.server;
const connectionType = data.connectionType;
if (event == 'Test finished') {
// here you can handle the case when test is finished, and remove listeners to prevent memory leaks
isListenerAdded = true;
handle.remove();
}
});
}
await SpeedChecker.startTest();
} catch (error) {
console.error(error);
}
});
self.shadowRoot.querySelector('#stopTestBtn').addEventListener('click', async function (e) {
try {
await SpeedChecker.stopTest();
SpeedChecker.removeAllListeners();
isListenerAdded = false;
} catch (error) {
console.error(error);
}
});
Note: Don't forget to run
npm run build
after modifying your app js file (such as capacitor-welcome.js), to apply the changes.
To uninstall the plugin, run the following commands
npm uninstall @speedchecker/capacitor-plugin
npx cap sync
Please check our demo application in Capacitor which includes a sample app with free speed test functionality
SpeedChecker is offering different types of licenses:
Items | Free | Basic | Advanced |
---|---|---|---|
Speed Test Metrics | Download / Upload / Latency | Download / Upload / Latency / Jitter | Download / Upload / Latency / Jitter |
Accompanying Metrics | Device / Network KPIs | Device / Network KPIs | Device / Network KPIs / Advanced Cellular KPIs |
Test Customization | - | test duration, multi-threading, warm-up phase etc | test duration, multi-threading, warm-up phase etc |
Location Permission | Required location permissions | - | - |
Data Sharing Requirement | Required data sharing | - | - |
Measurement Servers | - | Custom measurement servers | Custom measurement servers |
Background and passive collection | - | - | Background and Passive data collection |
Cost | FREE | Cost: Enquire | Cost: Enquire |
Yes! But the SDK collects data on network performance from your app and shares it with Speedchecker and our clients. The free SDK version requires and enabled location. Those restrictions are not in the Basic and Advanced versions
Yes, we have both Android and iOS SDKs.
Yes! YouTube video streaming, Voice over IP and other tests are supported by our native SDK libraries. Check out our Android and iOS API documentation
No, we provide support only on Basic and Advanced plans
The free version of our plugin allows getting basic metrics which are described in this API documentation
Full list of our KPIs for Basic and Advanced versions
Yes, you do not need to run any servers. We provide and maintain a network of high-quality servers and CDNs to ensure the testing is accurate. If you wish to configure your own server, this is possible on Basic and Advanced plans.
See our measurement methodology
Please contact us for more details and license requirements.