iOS Question Fetch download is not working for me


Active Member
Licensed User
I write a smal app to test fetch download but the "Private Sub Application_FetchDownload" was called once in Iphone 4S ( IOS 9.3.5 ) and in an Iphone 6 ( IOS 11.2.6 ) never.

The app is in attach if someone can help me.

I´m trying to find a alternative way to receive an alarm.

The main.m is saved in Files/Special

#Region  Project Attributes
    #ApplicationLabel: B4i Example
    #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>UIBackgroundModes</key><array><string>fetch</string></array>
    #CertificateFile: ios_distribution_2018.cer
    #ProvisionFile: ios_ad_hoc_2018.mobileprovision
#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

    Private Button1 As Button
End Sub

Private Sub Application_Start (Nav As NavigationController)
    'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
    NavControl = Nav
    Page1.Title = "Page 1"
    Page1.RootPanel.Color = Colors.White

Dim rl As ReleaseLogger
rl.Initialize("", 54323)


    Dim no As NativeObject = App
    no.RunMethod("setMinimumBackgroundFetchInterval:", Array(0)) '0 = minimum interval
End Sub

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

Private Sub Application_Background
End Sub

Private Sub Application_FetchDownload
   Log("FetchDownload "  & App.OSVersion & " (IOS) ")
   Dim ln As Notification
   ln.AlertBody = "Fetch download..." & App.OSVersion & " (IOS) "
   ln.PlaySound = True
       Dim xdata As String
    DateTime.DateFormat = "dd/MM/yyyy HH:mm:ss"
    xdata = DateTime.Date (DateTime.Now )
    Log  ( "**** Fetch " & App.OSVersion & " (IOS) - " & xdata )


Dim no As NativeObject = App
   no = no.GetField("delegate")
   no.RunMethod("completeFetch:", Array(0))
End Sub

Sub Button1_Click
           Dim xdata As String
    DateTime.DateFormat = "dd/MM/yyyy HH:mm:ss"
    xdata = DateTime.Date (DateTime.Now )
    Log  ( "**** Teste "  & App.OSVersion & " (IOS) - " & xdata )

End Sub


    465.2 KB · Views: 120


Active Member
Licensed User
I put the sleep command because the only time that I receive a notification with Iphone 4S I didn´t see the LOG.

The program is running all night in an Iphone 4S and Iphone 6 and I receive no notification.

Both today are connected to power and after 1 hour I get no notification.

In both case the software is running in a release mode
Upvote 0


Active Member
Licensed User
After more than one hour that both phone ( 4S and 6 ) is connected to power I received 3 times whith less than 10 minutes between them in Iphone 6 but no one in Iphone 4S.

I´ll wait for one more and disconnect from power to see if I receive any.
Upvote 0