This library allows you to integrate Apple's iAD services in your app.
Before you can use this service you need to agree to Apple's terms in iTunes Connect and set the bank and tax details.
Usage example:
You must set the correct size in Page_Resize event as done in the above code.
When the user presses on an ad the full ad will either be displayed inside your app or in the browser. If the app is displayed inside your app then the ActionBegin and ActionFinish events will fire when the ad is visible. You can use these events to "pause" your app while the app is displayed.
Test ads will show automatically when the app is signed with a non-store certificate.
Library installation
The zip file contains three files with the following extensions: .xml, .a and .h.
You need to copy the xml file to the internal libraries folder on the Windows computer.
If you are using a local Mac builder then you need to copy the .a and .h files to the Mac Libs folder.
Before you can use this service you need to agree to Apple's terms in iTunes Connect and set the bank and tax details.
Usage example:
B4X:
Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private iad As AdBannerView
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
iad.Initialize("iad", iad.SIZE_BANNER)
Page1.RootPanel.AddView(iad, 0, 100%y - 50dip, 100%x, 50dip)
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
Dim adHeight As Int
If App.iPadDevice Then
adHeight = 66dip
Else
If Width > Height Then 'landscape
adHeight = 32dip
Else
adHeight = 50dip
End If
End If
iad.SetLayoutAnimated(0, 1, 0, 100%y - adHeight, 100%x, adHeight)
End Sub
Sub iAD_ActionBegin
Log("action begin")
End Sub
Sub iAD_ActionFinish
Log("action finish")
End Sub
Sub iAD_FailedToReceiveAd (ErrorCode As String)
Log("Error: " & ErrorCode)
End Sub
Sub iAD_ReceiveAd
Log("Received ad")
End Sub
You must set the correct size in Page_Resize event as done in the above code.
When the user presses on an ad the full ad will either be displayed inside your app or in the browser. If the app is displayed inside your app then the ActionBegin and ActionFinish events will fire when the ad is visible. You can use these events to "pause" your app while the app is displayed.
Test ads will show automatically when the app is signed with a non-store certificate.
Library installation
The zip file contains three files with the following extensions: .xml, .a and .h.
You need to copy the xml file to the internal libraries folder on the Windows computer.
If you are using a local Mac builder then you need to copy the .a and .h files to the Mac Libs folder.