iOS Question App accepted to the AppStore works only on devices listed in UDID list

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.
I have a strange problem.

My app was accepted to the App Store but what I've found is that it works only on phones listed in UDID list in Devices in Certificates section.

If I try to install it on any other phones it installed successfully but when I started it it just shows me a login screen that looks like it was opened in IDE designer. If I in designer click on bil file and then click F2 the activity design preview opened on a phone I use for development (see attached image IMG_0101.png)
IMG_0101.PNG

Please see how it looks on a phone that wasn't added to the UDID list (IMG_0102)
IMG_0101.PNG

Please see how the same screen should look (IMG_0085)
IMG_0085.PNG

And on the first start of my app the

I remember that I had the same problem when I forgot to add a tester's phone UDID to Devices list and select this phone in my Add Hoc provision profile. When I tried install the app from TestFlight on a tester's phone I had the same problem. So I added tester's phone UDID into Devices list, selected it in Add Hoc provision profile, regenerated provision and downloaded on my development computer. I recompiled the app again, uploaded to the iTune Connect and then reinstalled on tester's phone - problem gone.

Now I have the same problem again even though the app was accepted into App Store.

I created only 1 certificate for iOS_Distribution as in Erel video. Then I created 2 provision profiles. Please see attached screensCertificate.pngIdentifiers.pngProfiles.png

In my code I use this


B4X:
'Code module
#CertificateFile: ios_distribution.cer
#Region  Project Attributes
    #ApplicationLabel: HCMS-EVV
    #Version: 1.0.32
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    #iPhoneOrientations: Portrait
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
    #Target: iPhone, iPad
    #ATSEnabled: True
    #MinVersion: 8  
       
    #If RELEASE
    #ProvisionFile: EVVReleaseOrg.mobileprovision
    #Else
    #ProvisionFile: EVVProfile.mobileprovision
    #End If
       
    #PlistExtra: <key>UIFileSharingEnabled</key><true/>
    #PlistExtra: <key>UIUserInterfaceStyle</key><string>Light</string>
    #PlistExtra:<key>NSLocationWhenInUseUsageDescription</key><string>Used to display the current navigation data.</string>
    #PlistExtra:<key>NSLocationUsageDescription</key><string>Used to display the current navigation data.</string>      
   
    #PlistExtra:<key>NSMicrophoneUsageDescription</key><string>Used to record the voice messages.</string>
   
    #PlistExtra:<key>NSPhotoLibraryUsageDescription</key><string>Select a photo.</string>
    #PlistExtra:<key>NSPhotoLibraryAddUsageDescription</key><string>Save photo in albums.</string>
    #PlistExtra:<key>NSCameraUsageDescription</key><string>Taking a photo.</string>  
#End Region

And also I created 2 Build Configurations Default that I use for development and Store - for compiling with store Package name and store provision profile.

On the App start in sub Application_Start I call login screen Show sub. And in Login Show sub I check if the airplane mode is off and if so check if Privacy accepted text

it's a first time start and if my code calls screen Privacy when user must accept privacy statement and once he accepted it Registration screen comes up. That's how it should work.

Please see Login screen Show code

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Private pg As Page
    Private x As XUI
    Public IsAttemptRegistrationOk As Boolean=True
    'Private TestRet As Boolean
    Private imgLogo As ImageView
    Private btnLogin As B4XView
    Private lblVersion As Label
    Private txtUserName As B4XView
    Private txtPassword As B4XView
    Private chTOS As Switch
    Private chPrivacyAccept As Switch
    Private lblViewTOS As Label
    Private lblViewPrivacy As Label
    Private lblRestorePassword As Label
    Private UserName As String,Password As String
    Private HUD As HUD,XUI As XUI
End Sub



Public Sub Show

    Try
   

        If pg.IsInitialized=False Then
            pg.Initialize("pg")
            pg.RootPanel.LoadLayout("Main")
        End If
               
        Main.NavControl.ShowPage(pg)
       
        pg.ResignFocus
       
        If Main.modFun.CheckAirplane Then
            X.MsgboxAsync("Please turn off the airplane mode or check if you allowed the network permission","HCMS")
            Return
        End If
               
        If Main.ParentScreen="PatientDetails" Then
            PatientDetails.Show
            Return
        Else If Main.ParentScreen="EmergencyMemo" Then
            EmergencyMemo.Show
            Return
        Else If Main.ParentScreen="FacilityDetails" Then
            FacilityDetails.Show
            Return
        Else If Main.ParentScreen="SelectedClient" Then
            SelectedClient.Show
            Return
        Else If Main.ParentScreen="UnscheduledClockIn" Then
            UnscheduledClockIn.Show
            Return
        End If
       
        If Main.IsExpired And Main.IsRegistered And Main.IsAccepted  Then
            X.MsgboxAsync("Your session has expired. Please login","HCMS")
            txtUserName.Text=""
            txtPassword.Text=""
            chTOS.Value=False
            Main.IsExpired=False
            chPrivacyAccept.Value=False          
            Return
        End If
   
        If Main.modFun.IsDebugMode Then
            chTOS.Value=True
            chPrivacyAccept.Value=True
        End If
       
        lblVersion.Text="HCMS-EVV Version 1.32 2/20/2021"
        btnLogin.SetColorAndBorder(Main.modFun.GetColor("blue"),3dip,Colors.White,8dip)
        btnLogin.Height=55dip
        lblVersion.Color=Colors.White
        txtUserName.SetColorAndBorder(Colors.white,1dip,Colors.Black,0dip)
        txtPassword.SetColorAndBorder(Colors.white,1dip,Colors.Black,0dip)
        lblRestorePassword.TextColor=Main.modFun.GetColor("blue")
       
        DateTime.DateFormat=Main.DateFormat
        DateTime.TimeFormat=Main.TimeFormatShow
       
        CheckLegal
       
        If Main.IsAccepted=False Then
            Return
        End If
       
        AddTable
        AddColumn
           
        If IsAttemptRegistrationOk=False Then
            Return
        End If
       
        Main.IsRegistered=CheckRegistration
       
        If Main.IsRegistered=False And Main.IsAccepted Then
           
            Registration.Show
           
            Return
           
        End If
       
    Catch
        Log("Login_Show " & LastException.description)
        Main.modFun.ShowError("Login_Show " & LastException.description)
    End Try
   
End Sub

Private Sub CheckLegal
   
    Try
        Dim TimeStamp As String
        Dim x As XUI
        Dim arr() As String
        Dim DateStr As String,TimeStr As String
       
        If File.Exists(Main.FileDir,"legal.txt") =False Then
           
            Legal.Show
            Return
        Else
           
        End If
               
        TimeStamp=File.ReadString(Main.FileDir,"legal.txt")
        TimeStamp=Main.modFun.Decrypt(TimeStamp)
                       
        arr=Main.modFun.Split(" ",TimeStamp)
       
        DateStr=arr(0)
        TimeStr=arr(1) & " " & arr(2)
                       
        If Main.modFun.IsValidDate2(DateStr,TimeStr)=False Then
           
            x.MsgboxAsync("Legal file is not valid","HCMS")
           
            Return
           
        End If
       
        Main.IsAccepted=True
       
        Main.AcceptedDate=TimeStamp
       
    Catch
        Log("Main_CheckLegal " &  LastException.description)
        Main.modFun.ShowError("Login_CheckLegal " &  LastException.description)
    End Try
   
End Sub



Private Sub AddTable
   
    Try
       
        Main.sql1.ExecNonQuery(modDB.tblNurseNotesSQL)
        Main.sql1.ExecNonQuery(modDB.tblPASchedule)
        Main.sql1.ExecNonQuery(modDB.tblPA)
        Main.sql1.ExecNonQuery(modDB.tblUnscheduledShifts)
        Main.sql1.ExecNonQuery(modDB.tblPhotoNotes)
        Main.sql1.ExecNonQuery(modDB.tblMailSettings)
        Main.sql1.ExecNonQuery(modDB.tblEmergencyMemo)
        Main.sql1.ExecNonQuery(modDB.tblLegal)
        Main.sql1.ExecNonQuery(modDB.tblMessages)
        Main.sql1.ExecNonQuery(modDB.tblNewCases)
        Main.sql1.ExecNonQuery(modDB.tblActivity)
        Main.sql1.ExecNonQuery(modDB.tblNewCases)
        Main.sql1.ExecNonQuery(modDB.tblSentMatchupRequests)
        Main.sql1.ExecNonQuery(modDB.tblSentDayOffRequests)
        Main.sql1.ExecNonQuery(modDB.tblViewedCases)
        Main.sql1.ExecNonQuery(modDB.tblReminder)
        Main.sql1.ExecNonQuery(modDB.tblCovidSymptomsByDeviceID)
        Main.sql1.ExecNonQuery(modDB.tblSymptoms)
       
    Catch
        Log("AddTable " & LastException.description)
        Main.modFun.ShowError("Login_AddTable " & LastException.description)
    End Try
   
End Sub

private Sub AddColumn
    Try
        modDB.AddColumn("tblMobileUserAccounts","ProviderTypeID","INTEGER")
        modDB.AddColumn("tblMobileUserAccounts","AccountStatusID","INTEGER")
        modDB.AddColumn("tblMobileUserAccounts","Covid","BIT")
        modDB.AddColumn("tblClientNeeds","MatchupID","INTEGER")
        modDB.AddColumn("tblClientNeeds","DOW","TEXT")
        modDB.AddColumn("tblClientNeeds","ParentNeedID","INTEGER")
        modDB.AddColumn("tblClientNeeds","ParentSkills","TEXT")
        modDB.AddColumn("tblNurseNotes","Latitude","float")
        modDB.AddColumn("tblNurseNotes","Longitude","float")
        modDB.AddColumn("tblNurseNotes","Photo","text")
        modDB.AddColumn("tblNurseNotes","NoteTime","SmallDateTime")
        modDB.AddColumn("tblNurseNotes","ToNoteTime","SmallDateTime")
        modDB.AddColumn("tblPlacementTasks","Note","Text")
        modDB.AddColumn("tblClients","Apartment","Text")
        modDB.AddColumn("tblClients","Distance","Float")
        modDB.AddColumn("tblClients","Latitude","Float")
        modDB.AddColumn("tblClients","Longitude","Float")
        modDB.AddColumn("tblClients","ScheduleMonitoring","BIT")
        modDB.AddColumn("tblClients","PriorityID","Integer")
        modDB.AddColumn("tblClients","EmergencyMemo","Text")
        modDB.AddColumn("tblClients","EmergencyMemoCreated","SmallDateTime")
        modDB.AddColumn("tblClients","EmergencyMemoCreatedBy","Text")
        modDB.AddColumn("tblClients","EmergencyMemoUpdated","SmallDateTime")
        modDB.AddColumn("tblClients","EmergencyMemoUpdatedBy","Text")
        modDB.AddColumn("tblPlacementSchedule","StartExplanation","Text")
        modDB.AddColumn("tblPlacementSchedule","FinishExplanation","Text")
        modDB.AddColumn("tblPlacementSchedule","AdjustedActualStart","SmallDateTime")
        modDB.AddColumn("tblPlacementSchedule","AdjustedActualFinish","SmallDateTime")
        modDB.AddColumn("tblPlacementSchedule","ActualHours","SmallDateTime")
        modDB.AddColumn("tblPlacementSchedule","PAID","INTEGER")
        modDB.AddColumn("tblPlacementTasks","Completed","BIT")
        modDB.AddColumn("tblNotesMediaFiles","FTPDate","SmallDateTime")
        modDB.AddColumn("tblNotesMediaFiles","Updated","SmallDateTime")
        modDB.AddColumn("tblClientsSchedule","Units","INTEGER")
        modDB.AddColumn("tblFacility","Address","Text")
        modDB.AddColumn("tblFacility","City","Text")
        modDB.AddColumn("tblFacility","State","Text")
        modDB.AddColumn("tblFacility","Zip","Text")
        modDB.AddColumn("tblFacility","Phone","Text")
        modDB.AddColumn("tblFacility","ProviderType","Text")
        modDB.AddColumn("tblFacility","Logo","Text")
        modDB.AddColumn("tblFacility","WebSite","Text")
        modDB.AddColumn("tblFacility","Fax","Text")
        modDB.AddColumn("tblFacility","RequestDays","INT")
        modDB.AddColumn("tblClientContacts","ProviderID","INTEGER")
        modDB.AddColumn("tblNewCases","ProviderID","INTEGER")
        modDB.AddColumn("tblNewCases","Viewed","SmallDateTime")
        modDB.AddColumn("tblNewCases","LanguagePreference","Text")
        modDB.AddColumn("tblNewCases","ScheduleMemo","Text")
        modDB.AddColumn("tblNurseNotes","NoteTime","SmallDateTime")
        modDB.AddColumn("tblReminder","ExpDate","SmallDateTime")
        modDB.AddColumn("tblPASchedule","UsedHrs","Float")
        modDB.AddColumn("tblPriorAuthorization","CheckPostActivePA","Bit")
       
    Catch
        Log("AddColumn " & LastException.description)
        Main.modFun.ShowError("Login_AddColumn " & LastException.description)
    End Try
End Sub




private Sub CheckRegistration As Boolean
       
    Try
        Dim MySQL As String=""
        Dim Qty As Int
        Dim Res As Boolean
               
        MySQL="select count(*) as Qty from tblUsers"
       
        Qty= Main.SQL1.ExecQuerySingleResult(MySQL)
       
        If Qty=0 Then
            Res= False
        Else
            Res=True
        End If
               
        Return Res
       
    Catch
        Log("CheckRegistration " & LastException.description)
        Main.modFun.ShowError("Main_CheckRegistration " & LastException.description)
       
        Return False
    End Try
   
End Sub


Here is a code for Main.modFun.ShowError

B4X:
public Sub ShowError(ErrorStr As String)
    Dim str As String=""
   
    str="IOS"
   
    Msgbox("ERROR:" & CRLF & ErrorStr,"HCMS")
   
    ErrorStr=str & "<hr/>" &  Main.DeviceID & "<hr/>" &  ErrorStr
   
    SendEmail(ErrorStr)
       
End Sub

It looks like in sub Show doesn't go below line 34 but no error messages shown.

What Am I missing?

Thank you.
 

Attachments

  • IMG_0102.jpg
    IMG_0102.jpg
    206.2 KB · Views: 183
Last edited:

Alex_197

Well-Known Member
Licensed User
Longtime User
There is no such thing. Store provision profiles are not limited to specific UUIDs.
Thank you for your reply, Erel.

But it looks like this - if I run the app on a phone from the UDID list - it works fine. If I run the app on a phone that is not on a list - it doesn't.

The only difference is that the same phone that is on UDID list the same app was used for TestFlight testing f this app before it was sent to release.

But I deleted TestFlight, deleted beta version of the app, load the app from App Store - works fine. Then I tried to load the app from the App store on a phone that wasn't used before - and I have this problem.
 
Upvote 0
Top