-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection Type to include Cellular Network Technology (e.g. 3G, 4G LTE, 5G) #150
Comments
Swift snippet import Network
import CoreTelephony
func checkNetworkType() {
let monitor = NWPathMonitor()
let queue = DispatchQueue(label: "NetworkMonitor")
monitor.pathUpdateHandler = { path in
if path.status == .satisfied {
// Device is connected to the internet
if path.usesInterfaceType(.cellular) {
// Cellular connection
let networkInfo = CTTelephonyNetworkInfo()
if let carrierType = networkInfo.serviceCurrentRadioAccessTechnology?.values.first {
switch carrierType {
case CTRadioAccessTechnologyLTE:
print("Connected via 4G (LTE)")
case CTRadioAccessTechnologyNRNSA, CTRadioAccessTechnologyNR:
print("Connected via 5G")
default:
print("Other cellular network (3G, etc.)")
}
}
} else if path.usesInterfaceType(.wifi) {
print("Connected via WiFi")
}
} else {
print("No internet connection")
}
}
monitor.start(queue: queue)
} |
Java code snippet, to use inside our
|
2 tasks
2 tasks
RN SDK will get this value in the device context data from the native SDKs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sentry events currently show Connection Type, but only with values
wifi
,ethernet
,cellular
, ornull
. https://github.com/getsentry/sentry-java/blob/5b8a9a6b2d40e03d1e5d0a38237db370c0f6cfd0/sentry-android-core/src/main/java/io/sentry/android/core/internal/util/ConnectivityChecker.java#L195Extend the
![image](https://private-user-images.githubusercontent.com/89550162/271435810-e8057091-1666-4597-9ac2-b059b4db7e15.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTQwNDAsIm5iZiI6MTczOTM1Mzc0MCwicGF0aCI6Ii84OTU1MDE2Mi8yNzE0MzU4MTAtZTgwNTcwOTEtMTY2Ni00NTk3LTlhYzItYjA1OWI0ZGI3ZTE1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA5NDkwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQyZmJkNWI2MWRjYzk5M2I5OGU4NWUyZWJiZjAyY2IxMDFmNTc4NWVmZTFkMzc2N2ZlYmJjY2IyYjJlMWM0MGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qx6KFJfiEo2fMKki61AvyIJ9-zFWOrbwf9f9x527Drw)
connection_type
field to include cellular network technology (3G, 4G LTE, and 5G etc.).The text was updated successfully, but these errors were encountered: