cellular

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cellular describes the phone's mobile network. Phones say less about this every year, so treat all of it as a hint.

nimbus native plugin add cellular

info, err := cellular.Get(ctx)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	HasSIM bool `json:"hasSim"` // whether a SIM is ready
	// Carrier is the network's name. iOS 16 stopped giving it to apps.
	Carrier string `json:"carrier"`
	Country string `json:"country"` // the network's country, such as "in"
	MCC     string `json:"mcc"`     // the mobile country code
	MNC     string `json:"mnc"`     // the mobile network code
	// Generation is "2g", "3g", "4g" or "5g". It's iOS only: Android asks
	// for a permission that isn't worth having for this.
	Generation string `json:"generation"`
	Roaming    bool   `json:"roaming"` // on another network; Android only
}

Info is what the phone will say. Anything it won't is empty.

func Get

func Get(ctx context.Context) (Info, error)

Get reads it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL