Last active
September 11, 2015 07:45
-
-
Save jukiginanjar/649e66cf46771ad18764 to your computer and use it in GitHub Desktop.
Checking what carrier you're using
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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