iOS Question [SOLVED] Extract Team ID

JackKirk

Well-Known Member
Licensed User
Longtime User
I'm trying to extract an apps Team ID using code based on the answer here:

http://stackoverflow.com/questions/...to-get-team-id-of-my-ios-app-programmatically

My effort is:
B4X:
#Region  Project Attributes
    #ApplicationLabel: Bug
    #Version: 1.0.0
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
    #Target: iPhone, iPad
    #ATSEnabled: True
    #MinVersion: 7
    #PlistExtra:<key>AppIdentifierPrefix</key><string>$(AppIdentifierPrefix)</string>

#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page

End Sub

Private Sub Application_Start (Nav As NavigationController)
    Dim rl As ReleaseLogger
    rl.Initialize("192.168.1.6", 54323)
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.Color = Colors.White
    NavControl.ShowPage(Page1)
End Sub

Private Sub Page1_Resize(Width As Int, Height As Int)
    Log(appIdentifierPrefix)
End Sub

Private Sub appIdentifierPrefix As String
    Dim no As NativeObject
    Return no.Initialize("NSBundle") _
        .RunMethod("mainBundle", Null).RunMethod("objectForInfoDictionaryKey:", Array("@""AppIdentifierPrefix""")).AsString
End Sub
But this blows up with B4ilogger saying:

Any help appreciated...
 

JackKirk

Well-Known Member
Licensed User
Longtime User
Thanks Erel, works a treat.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…