- From file menu select
File
->Add Package Dependencies...
- Enter https://github.com/Truphone/betterroaming-ios-sdk in the search field`
- Select
ebtterroaming-ios-sdk
package - Click
Add Package
button
import BetterRoamingSdk
// ...
var manager = BetterRomaingManager()
let supported: Bool = await manager.checkEsimSupport()
let body = [
"subscriber": [
"email": "...",
"first_name": "...",
"last_name": "...",
"country_of_residence": "GB"
],
"device": [
"operating_system": "ios"
],
"tenant": "...",
"externalID": "...",
"activation_token": "..."
]
let result: BRInstallEsimResult = try await manager.generateESimAndDownload(body: body)
/**
Result status can be 4 different values
- .unknwon -> user probably cancelled or something went wrong
- .fail -> installation failed
- .success -> installation succeeded (you should check result.iccid)
- .cancel -> user cancelled the installation (ios 17 or more)
*/
try await manager.openContactPage(params: ["tenant_id": "..."])
try await manager.openStatusPage(iccid: iccid)