B4i Library iAd library

This library allows you to integrate Apple's iAD services in your app.

SS-2015-01-19_10.23.05.png


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.
 

Attachments

  • iAD.zip
    9.9 KB · Views: 77

ilan

Expert
Licensed User
Longtime User
delete project folder from my mac, then rebuild and upload new build to the appstore? or do any test before uploading?

thanx, erel
 

ilan

Expert
Licensed User
Longtime User
answer from apple:

Hello,

We have verified that your app is using the Advertising Identifier, but is only serving ads.

To help locate the Advertising Identifier, use the “nm” tool. For information on the “nm” tool, please see the nm man page.

If you do not have access to the libraries' source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool lists the methods that the library calls, and "otool -ov" will list the Objective-C class structures and their defined methods. These techniques can help you narrow down where the problematic code resides.

It is necessary to remove any instances of:

class: ASIdentifierManager
selector: advertisingIdentifier
framework: AdSupport.framework

Best Regards,

App Store Review
 

ilan

Expert
Licensed User
Longtime User
thank you erel for your patience, but i have decided to use for now only admob or no ads app, because it takes weeks until they approve my apps.
those two apps will not iclude any ads (i have uploaded new builds, hopefully they will be approved soon)

thanks again

regards, ilan
 

Haris Hafeez

Active Member
Licensed User
Longtime User
Hello All,

Can someone please elaborate a bit on the following guidelines mentioned in Apple's iAd documentation?

  1. Hide blank or empty banner space. Should we use iAD_ReceiveAd to show the banner view and iAD_FailedToReceiveAd (meaning no ad received for any reason) to hide it?
  2. Share ADBannerView Instances Across Views. Does this mean we should only create one instance of AdBannerView in our app(perhaps in Main) and then re-use it across all the pages where we want to show an ad banner?
    1. I tried to do this and the banner goes blank when moving to and from the Main page. Not sure what the best way of doing this is.
  3. Display iAd Banners for at Least 30 Seconds. When are the ads rotated? The description from Apple suggests its up to the developer to rotate them, hence the requirement to show them for 30 seconds.
The link to Apple's documentation is this:

https://developer.apple.com/iad/resources/Implementing-iAd-in-Your-iOS-Apps.PDF

Many thanks.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
For now I recommend you to use iAdMob library due to the unresolved issue discussed above.

1. Keep the view visible and move it in or out of the page's visible space based on these events.

2. You can move the view in the Page_Appear event.

3. This is only relevant if you manually call for a new ad (not sure how it can be done with their API).
 
D

Deleted member 103

Guest
For now I recommend you to use iAdMob library due to the unresolved issue discussed above.
I absolutely agree.
It is the second app was not approved because of the iAd advertising, this time even during an update. :(
From now on I will use only iAdmob.
 

abhishek007p

Active Member
Licensed User
Longtime User
For now I recommend you to use iAdMob library due to the unresolved issue discussed above.

issues related iAds has been resolved or not ? whats the current status ? or developers should use iAdMob instead ?
 

ilan

Expert
Licensed User
Longtime User
issues related iAds has been resolved or not ? whats the current status ? or developers should use iAdMob instead ?

Still same status, you better use iadmob for now, there is a chance they will approve your app With iad but if not only because iad then you will need to wait another 8 days
 

tufanv

Expert
Licensed User
Longtime User
Iad's ecpm rates are higher. Is there any news when this will be fixed or what is the problem with iad on b4i ? We need these tools to have some money from the apps
 

ilan

Expert
Licensed User
Longtime User
If you are using a local mac try to delete all files in the build folder on your mac, then make sure iadmod is unchecked and build your app.

After submit your build you will be asked on 3 questions first 2 you choose no and the last one ask if your app provide 3rd party ads you should also choose NO only with admob we choose yes but iad we choose no and submit for review.

Good luck
 
Last edited:

tufanv

Expert
Licensed User
Longtime User
If you are using a local mac try to delete all files in the build folder on your mac, then make sure iadmod is unchecked and build your app.

After submit your build you will be asked on 3 questions first 2 you choose no and the last one ask if your app provide 3rd party ads you should also choose NO only with admob we choose yes but iad we choose no and submit for review.

Good luck
can you say anything about the ecpm rates of iad compared to admob ? Is it really higher than admob
 

ilan

Expert
Licensed User
Longtime User
can you say anything about the ecpm rates of iad compared to admob ? Is it really higher than admob

i don't think i can because i tried iad on a poor game that has not much downloads and also iad doesn't support interstitial ads (as far as i know) so i think the good money is in interstitial ads and for know iadmob only support it.. correct me if i am wrong
 

tufanv

Expert
Licensed User
Longtime User
Yes you are right. it is just for ipads i tihnk.
i don't think i can because i tried iad on a poor game that has not much downloads and also iad doesn't support interstitial ads (as far as i know) so i think the good money is in interstitial ads and for know iadmob only support it.. correct me if i am wrong
 

tufanv

Expert
Licensed User
Longtime User
I think iad is supporting interstitials, but the code is only for banners. What can we do to show interstitials ?
 

MikeH

Well-Known Member
Licensed User
Longtime User
FYI.... I just uploaded an iOS app that uses iAdMob and I wasn`t allowed to say "No" for the question about my app using an Advertising Identifier. When I clicked "Yes" I then had to fill another page where I was asked why the identifier is used. One of the tick boxes is to say it is for serving ads, so I selected that.

Time will tell if I`ve done everything correctly.
 
Top