Is there any way to determine if the iphone is roaming?

前端 未结 3 1673
太阳男子
太阳男子 2020-11-28 06:38

I am working on an iPhone application and would really like to determine if the device is roaming so that I can intelligently avoid costing my users expensive connections if

3条回答
  •  -上瘾入骨i
    2020-11-28 06:40

    the solution of the symlinks are not the only way to do it but definitely it is the best. As I just realized, the Strings returned contains the MCC and MNC codes of the operator and carrier!!! Even the core telephony framework is not able to retrieve those informations about the operator your iPhone is attached when in roaming.

     Logs: 
     carrier: /System/Library/Carrier Bundles/iPhone/72410/carrier.plist
     operator: /System/Library/Carrier Bundles/iPhone/20810/carrier.plist
    

    As you can see, the carrier (original cellular provider) line contains the file inside the "folder" 72410, which means MCC 724 (Brazil) and MNC 10 (VIVO). The operator (actually the one my cell phone is attached now - i'm in roaming) is inside the folder 20810, which means MCC 208 (France) and MNC 10 (SFR).

    By the way, I'm using iPhone 4 with iOS5.

提交回复
热议问题