Skip to content

Instantly share code, notes, and snippets.

@jukiginanjar
Last active September 11, 2015 07:45
Show Gist options
  • Save jukiginanjar/649e66cf46771ad18764 to your computer and use it in GitHub Desktop.
Save jukiginanjar/649e66cf46771ad18764 to your computer and use it in GitHub Desktop.
Checking what carrier you're using
//
// CarrierChecker.m
// RagunanZoo
//
// Created by Nanang Rafsanjani on 8/26/15.
// Copyright (c) 2015 Onebit. All rights reserved.
//
#import "CarrierChecker.h"
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
#import "Macros.h"
@implementation CarrierChecker
+ (BOOL)isUsingIndosat {
CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netinfo subscriberCellularProvider];
DebugLog(@"Mobile Country Code: %@", [carrier mobileCountryCode]);
DebugLog(@"Mobile Network Code: %@", [carrier mobileNetworkCode]);
DebugLog(@"Mobile Network Name: %@", [carrier carrierName]);
//mcc 501 = indonesia
//mnc 01 = Indosat
//https://en.wikipedia.org/wiki/Mobile_country_code
return [[carrier mobileCountryCode] isEqualToString:@"510"] && [[carrier mobileNetworkCode] isEqualToString:@"01"];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment