关于iOS在程序中检测sim卡切换和获取手机号的问题

1.根据IOS SDK提供的接口无法在应用关闭的情况下检测到SIM卡的状态改变,只有在应用开启状态下才可以检测到。

          以下是苹果文档提供的信息:

          Use the CTTelephonyNetworkInfo class to respond to changes in the user’s cellular service provider. This occurs, for example, if a  user swaps the device’s SIM card with one from another provider, while your application is running.


2.根据IOS SDK提供的接口无法获取手机号码,如果使用私有API获取手机号码会被苹果商店拒绝。

       以下是因为获取手机号被苹果商店拒绝的理由:

       "For security reasons, iPhone OS restricts an application (including its preferences and data) to a unique location in the file system. This restriction is part of the security feature known as the application's "sandbox." The sandbox is a set of fine-grained controls limiting an application's access to files, preferences, network resources, hardware, and so on."


The device's phone number is not available within your application's container. You will need to revise your application to read only within your directory container and resubmit your binary to iTunes Connect in order for your application to be reconsidered for the App Store.

你可能感兴趣的:(iOS分享)