B4i Library Leadbolt Ads

This library allows you to show and play Leadbolt ads.
You need to first register with Leadbolt: www.leadbolt.com

To show an ad:
1. Add this line to disable https limitations:
B4X:
#PlistExtra:<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict>

2. Initialize LeadBolt object with your key.
3. Call LoadModuleToCache to load an ad (module should be inapp or video).
4. Call ShowModule to show a previously loaded ad.

Monitor the logs for relevant messages.

B4X:
#PlistExtra:<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict>
Sub Process_Globals
   Public App As Application
   Public NavControl As NavigationController
   Private Page1 As Page

   Private lb As Leadbolt
End Sub

Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   NavControl.ShowPage(Page1)
   Page1.RootPanel.LoadLayout("1")
   lb.Initialize("lb", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbXNCRKiQGgP")
   lb.LoadModuleToCache("inapp")
End Sub

Private Sub Page1_Click
   lb.ShowModule("inapp", Page1)
End Sub

Private Sub lb_Loaded

End Sub

Private Sub lb_Failed

End Sub

Private Sub lb_Closed

End Sub

Private Sub lb_Clicked

End Sub

Private Sub lb_Cached

End Sub

Private Sub lb_MediaFinished

End Sub

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.
- Download Leadbolt SDK and copy libAppTracker.a to the Mac Libs folder.
 

Attachments

  • iLeadbolt.zip
    8.2 KB · Views: 80
Last edited:

susu

Well-Known Member
Licensed User
Longtime User
@ilan , AirPush just released wrapper for their iOS SDK, give it a try.
 

susu

Well-Known Member
Licensed User
Longtime User
Me too. I just fill the form for non-US resident and it's ok.
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
I need a problem with event in my library:

In a event of my library started by

in ObjectiveC (library)
B4X:
[B4IObjectWrapper raiseEventFromDifferentThread:self :@"_onselected:" :@[pRet];

in B4i
B4X:
Sub omyobj_onSelected(ItemName As String)

   hd.ProgressDialogShow("Downloading Messages...")

EndSub


Problem: The HUD and TOAST not appear, but if is out of this event the HUD appear normally.

Obs: The event _onSelected works perfectly
 

fishwolf

Well-Known Member
Licensed User
Longtime User
I have download last LeadBold sdk (7.0 ver.) i don't find libAppTracker.a file

i have try to copy framework folder (like admob) but don't compile
 
Last edited:

fishwolf

Well-Known Member
Licensed User
Longtime User
i have write them, but they haven't a b4i library (only b4a).

can you post here the libAppTracker.a compatible with iLeadbolt library b4i (Ver.1.32 with last b4i Ver. 2.51)
I have a mac builder, i suppose the remote builder work fine.

Or update iLeadbolt library b4i to last sdk, 7.0 support also the native.

Thanks
 

fishwolf

Well-Known Member
Licensed User
Longtime User
Sorry....

Now i can compile, but if i run the example with my LeadBolt key, i have this error

B4X:
Copying updated assets files (1)
Application_Start
Error occurred on line: 29 (Main)
+[AppTracker loadModuleToCache:]: unrecognized selector sent to class 0xba1c0
Stack Trace: (
  CoreFoundation       <redacted> + 150
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 0
  CoreFoundation       <redacted> + 702
  CoreFoundation       _CF_forwarding_prep_0 + 24
  B4i Example          -[b4i_main _application_start:] + 2004
  CoreFoundation       <redacted> + 68
  CoreFoundation       <redacted> + 292
  B4i Example          +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
  B4i Example          -[B4IShell runMethod:] + 574
 B4i Example          -[B4IShell raiseEventImpl:method:args::] + 2212
 B4i Example          -[B4IShellBI raiseEvent:event:params:] + 1442
 B4i Example          __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
 libdispatch.dylib    <redacted> + 10
 libdispatch.dylib    <redacted> + 22
 libdispatch.dylib    _dispatch_main_queue_callback_4CF + 1532
 CoreFoundation       <redacted> + 8
 CoreFoundation       <redacted> + 1590
 CoreFoundation       CFRunLoopRunSpecific + 516
 CoreFoundation       CFRunLoopRunInMode + 108
 GraphicsServices     GSEventRunModal + 160
 UIKit                UIApplicationMain + 144
 B4i Example          main + 108
 libdyld.dylib        <redacted> + 2
)
Application_Active
 
Top