registerOnMobileCountryCodeChanged static method
Register a callback invoked when the device mobile country code (MCC) changes.
This is useful for reacting to SIM/region changes on devices. The API is currently only supported on Android.
Parameters
callback: Function called with the new mobile country code (MCC) as anint.
Throws
- PlatformException when the platform does not support this callback (non-Android).
Implementation
static void registerOnMobileCountryCodeChanged(
void Function(int mobileCountryCode) callback,
) {
if (!Platform.isAndroid) {
throw PlatformException(
code: 'PlatformNotSupported',
message: 'The platform is not Android.',
);
}
_onMobileCountryCodeChanged = callback;
}