Upgrading from 2.x
3.0 is a major release. This page lists what changes for an app moving from 2.0.0, breaking changes first. The 2.0 docs stay at /docs/v2.0/. For the full list, see What's new in 3.0.
1. Update the version
.package(url: "https://github.com/octetproof/octet-sdk-ios", exact: "3.0.0")
implementation("com.octetproof:sdk:3.0.0")
If you verify proofs yourself with octet-verify, run 1.5.0 or later. To enforce a verdict tier on your backend with --require-verdict, run 1.6.0 or later.
2. Review the breaking changes
Usage reporting is always on
After the first proof of each UTC day, the SDK sends one device_active usage record with the next background heartbeat, so Octet can count active devices for billing. The record carries no location, no proof data, no user or account identity and no new device identifier. It never blocks or delays a proof.
OctetConfig.creditServiceUrl, previously a reserved opt-in field, now defaults to https://credits.octetproof.com and only overrides the endpoint for testing. Leaving it unset, or setting it to nil / null, no longer disables anything. The default is exposed as OctetConfig.defaultCreditServiceUrl (iOS) and OctetConfig.DEFAULT_CREDIT_SERVICE_URL (Android). CreditStatus gains an optional reason.
Update your app's privacy disclosures to include the daily usage record. See Data collection and Metrics and usage reporting.
US territories claim their own country
A device in Puerto Rico, Guam, the US Virgin Islands, American Samoa, the Northern Mariana Islands or the US Minor Outlying Islands now claims that territory's ISO 3166 code: PR, GU, VI, AS, MP or UM. A country("US") query answers NO there. To accept those users, add the territory codes to your region list.
let accepted = ["US", "PR", "GU", "VI", "AS", "MP", "UM"]
for code in accepted {
let v = await sdk.loc.isWithin(region: .country(isoCode: code))
if v.result == .yes { return v }
}
val accepted = listOf("US", "PR", "GU", "VI", "AS", "MP", "UM")
for (code in accepted) {
val v = sdk.loc.isWithin(OctetRegion.country(code))
if (v.result == OctetVerdict.Result.YES) return v
}
Country and state claims follow real borders
The SDK claims a country or a state only when the device is clearly inside it. Close to a border, or when the location fix is too coarse to tell, a country or state query returns INDETERMINATE with reason regionUnresolved (REGION_UNRESOLVED on Android) where 2.0.0 answered YES or NO. Handle that reason as a benign gap, for example with a retry or a step-up check. See Verdicts.
State claims now also work outside the US, starting with Ukraine and Russia. Crimea, Sevastopol, Donetsk, Luhansk, Zaporizhzhia and Kherson always claim UA.
A pinned claimedRegion must be an assigned ISO 3166 code
A pinned claimedRegion whose code is malformed or not assigned in ISO 3166 produces no proof, and the verdict reason is regionUnresolved. 2.0.0 signed it.
Android: a debugger refuses proofs outside a sandbox session
An attached debugger or native tracer now refuses a proof with TAMPERING, as on iOS. A sandbox session (sandboxBypassToken set) still allows one, so debugging against the sandbox keeps working.
Android: BootstrapReason.NewDevicesBlocked
BootstrapReason gains NewDevicesBlocked. A when (reason) over BootstrapReason without an else branch no longer compiles. Add the new case or an else branch:
try {
val sdk = Octet.start(context = applicationContext, config = config)
} catch (e: LicenseError.BootstrapFailed) {
when (e.reason) {
// Open the server-signed link exactly as received.
BootstrapReason.NewDevicesBlocked -> e.upgradeUrl?.let { openInBrowser(it) }
else -> showStartupError(e)
}
}
On iOS the new case is .newDevicesBlocked(upgradeUrl:). A switch with a default keeps compiling. See License Types.
Android: Kotlin binary compatibility
AdvancedConfig and LicenseStatus gained constructor parameters with defaults. Source that uses named arguments compiles unchanged. Code compiled against 2.0.0 that calls their constructors or copy must be recompiled.
3. Check the behavior changes
- iOS: direct mode uses
ipwho.isfor IP location instead ofipapi.co. Addipwho.isto any network allowlist, or setTransportPolicy.thirdPartyto.disable. - The first proof after
Octet.startwaits for startup to finish, for up to 30 s, instead of returningnoFix/NO_FIX. If your app applies its own timeout to the first call, allow for this. - On a fresh install,
Octet.startcan take a few seconds longer while it retries the first remote-configuration fetch. achievableLevelreportssubdivision, nevercity, when the fix is too coarse for the requested level.- A cached activation is reused only with the same licence and server. Starting offline with an activation from a different licence or server fails with
noActivation/LicenseError.NoActivation. - TLS pins. The built-in pins for
api.octetproof.comandgw.octetproof.comare updated. If you turned on certificate pinning with 2.0.0, upgrade to 3.0.0.
4. Adopt what is new
- Gateway routing. Route every SDK network call through your own HTTPS host or through
gw.octetproof.comwithOctetConfig.advanced.transport. See Gateway routing. - Assurance tier. Read
LocationProof.spoofingVerdictto decide what aYESis worth. SeeOctetVerdict. - Verdict tier on verification.
VerifyOptions.requireVerdictfails a proof below the tier you require. SeeOctet.verify. PLAUSIBLEcontainment. Turn onOctetConfig.advanced.acceptPlausibleContainmentto let disc queries answer from aPLAUSIBLEproof. See Predicates.- Upgrade link on new-device refusal. Handle
newDevicesBlockedand open itsupgradeUrl. See License Types.