SDK reference
Options, status and errors
Every package has the same options and functions under names that suit its language. This page lists them side by side, what each status means, and how to fix each message.
Functions
| Android (Kotlin, Java) | .NET | Node.js, Electron | Python | C | |
|---|---|---|---|---|---|
| Start | IdlePay.start(context, key, consent) | Sdk.Start(options) | start(options) | start(key=…, data_dir=…, consent=…) | IdlePayStartKey(key, data_dir, consent) |
| Stop | IdlePay.stop(context) | Sdk.Stop() | stop() | stop() | IdlePayStop() |
| Pause, resume | IdlePay.setPaused(true) | Sdk.SetPaused(true) | setPaused(true) | set_paused(True) | IdlePaySetPaused(1) |
| Reconnect now | automatic | Sdk.Reconnect() | reconnect() | reconnect() | IdlePayReconnect() |
| Status | IdlePay.status() | Sdk.Status() | status() | status() | IdlePayStatus() |
| Consent screen | IdlePay.askConsent(activity, appName) | your own | askConsent(options)Electron only | your own | your own |
| Saved consent | IdlePay.consent(context)IdlePay.setConsent(context, agreed) | your own | consent(dir)setConsent(dir, agreed) | your own | your own |
- Start returns at once and shares in the background until stop. It fails with an error (an exception, or a message in C) if it can't start: see Start errors. Problems after that, such as an unapproved account, show in the status instead.
- Stop waits a few seconds at most. Calling it when the SDK isn't running does nothing.
- Pause keeps the SDK running without sharing. Paused time doesn't count toward hours.
- Reconnect is optional: the SDK notices network changes by itself, just a little later.
Options
| Option | Android | .NET | Node.js | Python | C (JSON) |
|---|---|---|---|---|---|
| SDK key | key | Key | key | key | "key" |
| Consent | consent | Consent | consent | consent | "consent" |
| Data folder | set by the helper | DataDir | dataDir | data_dir | "data_dir" |
| Daily limit (MB) | maxDailyMB | MaxDailyMB | maxDailyMB | max_daily_mb | "max_daily_mb" |
| Device name | set by the helper | Name | name | name | "name" |
| Install id | set by the helper | DeviceId | deviceId | device_id | "device_id" |
- SDK key (required): your app's key from the SDK page, starting with
ipsk_. It ships inside your app. - Consent (required):
trueonly once the user agreed to share. The SDK refuses to start without it. - Data folder (required on desktop): a folder your app owns, where the SDK keeps its device token and state. Use a per-user folder that isn't synced to other computers, such as
%LOCALAPPDATA%\YourApp\idlepayon Windows,~/Library/Application Support/YourApp/idlepayon macOS, or~/.local/share/yourapp/idlepayon Linux. If it's deleted, the SDK links again and keeps the same device. - Daily limit: pause sharing for the rest of the UTC day once this device has shared this many MB.
0(the default) means no limit. - Device name: how the device shows on your SDK page. Empty uses the computer's system name.
- Install id: leave it empty on desktops: the SDK uses the computer's id together with the data folder, so two apps on one computer are two devices. If you set it, it must stay the same for this install and differ between devices. Never use a personal identifier. Only a one-way hash of it reaches us.
Status
| Field | Android | .NET | Node.js, Python, C | What it is |
|---|---|---|---|---|
| Running | running | Running | running | The SDK is started. |
| State | state | Value | state | One of the states below. |
| Message | message | Message | message | Why it's in that state, when there's something to say. |
| Public IP | publicIP | PublicIp | public_ip | The IP address the device shares. |
| Device id | deviceID | DeviceId | device_id | The device's number on your SDK page, once linked (0 before). Save it in your consent record. |
States
| State | What it means |
|---|---|
| connecting | Linking the device, or connecting to IdlePay. Normal for a few seconds. If it stays, read the message. |
| checking | IdlePay is checking the connection: home or not, its exit IP, HTTPS. Takes up to about a minute. |
| online | Checked and sharing. Every full hour in this state earns. |
| duplicate | Another device on the same IP address is already shared. This one waits and takes over if the other leaves. Normal in households. |
| disabled | This connection isn't eligible. The message says why. It's checked again every 30 minutes. |
| paused | Your app paused it, the Android helper paused it on mobile data, or the daily limit was reached. |
| failed | The connection couldn't be reached or checked. Retried automatically. |
| offline | IdlePay can't be reached right now, for example with no internet. Retried automatically. |
| stopped | The SDK isn't running: it wasn't started, was stopped, or couldn't run (see the message). |
Start errors
| Error | What to do |
|---|---|
| the user hasn't agreed to share their connection (Options.Consent) | Pass consent as true, and only after the user agreed. |
| Options.Key must be an SDK key (ipsk_…) from the IdlePay dashboard | Copy your app's key from the SDK page. Enrollment keys (ipk_) are for the IdlePay app, not the SDK. |
| Options.DataDir is required | Pass a data folder your app owns. |
| already started | Start the SDK in one place only, or stop it before starting it again. |
| options are not valid JSON | C only: check the JSON you pass, especially escaped quotes and backslashes in paths. |
Status messages
| Message | What to do |
|---|---|
| linking this device to the app's IdlePay account | Nothing: it's the first few seconds after the first start. |
| can't link this device yet: This app's IdlePay account isn't approved for the SDK program. | Your account isn't approved yet, or approval was withdrawn. See Get approved. The SDK tries again by itself, waiting longer each time, up to every 6 hours. |
| can't link this device yet: This enrollment key is invalid, expired or used up. | The key is mistyped or was revoked. Copy it again, or create a new one on the SDK page. |
| can't link this device yet: This account can't add devices. | Your account is suspended. Check your dashboard. |
| not sharing: another copy of this app is already sharing from this data folder | Two running copies of your app use the same data folder. Start the SDK in one copy only. |
| Can't reach IdlePay right now — retrying… | No internet, or a firewall blocks outgoing connections. It retries by itself. |
| this app's IdlePay account isn't approved for the SDK program | Approval was withdrawn while devices were connected. Contact support. Devices try again every hour. |
| this app's IdlePay key was revoked | The key in this version of your app was revoked. Release an update with a new key. |
| this app's IdlePay account is suspended | Check your dashboard. |
| another device on this network already shares it | Nothing: one device per IP address is used (duplicate). |
| this connection goes through a VPN; only a home connection can be shared | Nothing to fix in your app. It counts again once the device is off the VPN. |
| this is a server or hosting connection; only a home connection can be shared | The device is on a server, a cloud machine or an office network that isn't residential. Test on a home connection. |
| Tor exits can't be shared | The device's IP is a Tor exit. |
| IdlePay couldn't verify this connection; it will try again | Nothing: it's checked again later. |
| this connection goes through a shared proxy | The device reaches the internet through a proxy. Only its own connection counts. |
| this IP is an IdlePay static proxy | IdlePay's static proxies can't be shared. |
| traffic leaves this device from another IP than its connection to IdlePay | Something on the device (a VPN with split tunneling, a proxy) sends traffic out another way. |
| something on this connection intercepts HTTPS (antivirus HTTPS scanning or a filtering proxy) | Antivirus "HTTPS scanning" or a filtering proxy replaces websites' certificates. Such connections aren't used. |
| this connection's IP keeps changing | The device's public IP changes too often to be shared. |
Library loading errors (DllNotFoundException in .NET, an error at require in Node.js, OSError at import in Python) mean the library file is missing, in the wrong place, or for another system or CPU. See your platform's guide.