1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

iOS Question Retrieving Carrier Name from iPhone programmatically

Discussion in 'iOS Questions' started by ykucuk, May 23, 2019.

  1. ykucuk

    ykucuk Well-Known Member Licensed User

    Hello,

    How can i get Carrier Name from iPhone programmatically ?
     
  2. Computersmith64

    Computersmith64 Well-Known Member Licensed User

    There is a framework available (CoreTelephony) that provides that information, however I don't think it has been implemented in B4i. There is an example here -> How to read missed calls or check phone state? on how to use CoreTelephony with inline Java, so that might point you in the right direction.

    - Colin.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Find an Objective C or Swift code and I will help you port it.
     
  4. ykucuk

    ykucuk Well-Known Member Licensed User

  5. Erel

    Erel Administrator Staff Member Licensed User

    Untested code:
    Code:
    Dim netinfo As NativeObject
    netinfo = netinfo.Initialize(
    "CTTelephonyNetworkInfo").RunMethod("new"null)
    Dim carrier As nativeObject = netinfo.RunMethod("subscriberCellularProvider"Null)
    Log(carrier.RunMethod("carrierName"Null).AsString)
     
  6. ykucuk

    ykucuk Well-Known Member Licensed User

    it works
     
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice