v2
github.com/rinchsan/device-check-go/v2
go get github.com/rinchsan/device-check-go/v2
v2

github.com/rinchsan/device-check-go/v2

📱 iOS DeviceCheck SDK for Go - query and modify the per-device bits

by Masaya Hayashi

v2.0.0 (see all)License:MIT
go get github.com/rinchsan/device-check-go/v2
Readme

device-check-go

📱 iOS DeviceCheck SDK for Go - query and modify the per-device bits

Installation

go get github.com/rinchsan/device-check-go/v2

Getting started

Initialize SDK

import "github.com/rinchsan/device-check-go/v2"

cred := devicecheck.NewCredentialFile("/path/to/private/key/file") // You can create credential also from raw string/bytes
cfg := devicecheck.NewConfig("ISSUER", "KEY_ID", devicecheck.Development)
client := devicecheck.New(cred, cfg)

Use DeviceCheck API

Query two bits

var result devicecheck.QueryTwoBitsResult
if err := client.QueryTwoBits("DEVICE_TOKEN", &result); err != nil {
    switch {
    // Note that QueryTwoBits returns ErrBitStateNotFound error if no bits found
    case errors.Is(err, devicecheck.ErrBitStateNotFound):
        // handle ErrBitStateNotFound error
    default:
        // handle other errors
    }
}

Update two bits

if err := client.UpdateTwoBits("DEVICE_TOKEN", true, true); err != nil {
    // handle errors
}

Validate device token

if err := client.ValidateDeviceToken("DEVICE_TOKEN"); err != nil {
    // handle errors
}

Apple documentation

GitHub Stars

11

LAST COMMIT

8mos ago

MAINTAINERS

0

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v2.0.0
6mos ago
No alternatives found
No tutorials found
Add a tutorial