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:

fishwolf

Well-Known Member
Licensed User
Longtime User
if it's true, all old applications with this library go to in crash!!!

work fine with remote builder?

but only me of b4i users use this library?
 

fishwolf

Well-Known Member
Licensed User
Longtime User
Seems to work fine. Which error do you get?
B4X:
Copying updated assets files (1)
Application_Start
Error occurred on line: 29 (Main)
+[AppTracker loadModuleToCache:]: unrecognized selector sent to class 0xa61c0
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
 

ilan

Expert
Licensed User
Longtime User

Similar Threads

Top