Author Topic: iAd Banner - Technical only  (Read 39015 times)

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: iAd Banner - Technical only
« Reply #15 on: 2010-Jul-21 »
i got kungphoos glbasic view and changed the singleton to my own objC class.

EDIT:// download in this post

[attachment deleted by admin]
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline baicskillet

  • Mc. Print
  • *
  • Posts: 29
    • View Profile
Re: iAd Banner - Technical only
« Reply #16 on: 2010-Jul-21 »
Sounds good trucidare.  :) I can't get mousestate.  :'( How did you fix it?

Code: GLBasic [Select]
// --------------------------------- //
// Project: iAdTest
// Start: Friday, June 25, 2010
// IDE Version: 8.002

REQUIRE "import.c"
IMPORT "C" int GLB_iAd_Init()

Animate()

FUNCTION Animate:
        LOCAL mx,mx,b1,b2
       
        GLB_iAd_Init()
        WHILE TRUE
                MOUSESTATE mx,my,b1,b2
                DRAWRECT 0,50,320,100,RGB(0,255,0)
                PRINT "GLB: Hello iAd world!",10,60+SIN(GETTIMERALL()*0.1)*10
                DRAWRECT mx-10,mx-10,20,20,RGB(255,0,0)
                SHOWSCREEN
        WEND
ENDFUNCTION
 

This code here is slightly different from the one available for download.  I think it has an additional mousestate command.  Which one is the final one?

Offline baicskillet

  • Mc. Print
  • *
  • Posts: 29
    • View Profile
Re: iAd Banner - Technical only
« Reply #17 on: 2010-Jul-21 »
Oh, and I dont know where to find those iad and CoreGraphics Frameworks.

Offline baicskillet

  • Mc. Print
  • *
  • Posts: 29
    • View Profile
Re: iAd Banner - Technical only
« Reply #18 on: 2010-Jul-21 »
i got kungphoos glbasic view and changed the singleton to my own objC class.

EDIT:// download in this post

Does this wrapper replace matchy's glb_iad solution?

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: iAd Banner - Technical only
« Reply #19 on: 2010-Jul-21 »
it is a standalone lib. read Readme.txt for function names.
it is matchys idea with my patch for get input working
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline baicskillet

  • Mc. Print
  • *
  • Posts: 29
    • View Profile
Re: iAd Banner - Technical only
« Reply #20 on: 2010-Jul-22 »
it is a standalone lib. read Readme.txt for function names.
it is matchys idea with my patch for get input working

Could you walk me through adding it? The readme shows three functions, GLB_iad, GLB_iad_hide and GLB_iad_show.  I added them to my game.  Do i need to include that libiad.a file too? And how do i do that if it's needed?  Are these functions related to the GLB_iad_init one from matchy's solution? And they are void instead of int like GLB_iad_init.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: iAd Banner - Technical only
« Reply #21 on: 2010-Jul-22 »
baicskillet, add the existing framework and lib in xcode!
trucidare, I tried out the lib and the result was I there was mousestate feedback and the banner frame slides nicely.
Although there is no advert text or image in the banner test frame (server issue), there now is no response when tapping the advert.

Code: GLBasic [Select]
//iAd Banner Lib Test
//undelcared variables are psuedo

IMPORT "C" void GLB_iAd()
IMPORT "C" void GLB_iAd_Hide() // to hide the banner
IMPORT "C" void GLB_iAd_Show() // to show banner after hide

GLB_iAd()
WHILE TRUE
        if time_to_show
                GLB_iAd_Show()
        elseif time_to_hide
                GLB_iAd_Hide()
        endif
        PRINT banner_state,0,0
        SHOWSCREEN
WEND
 

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: iAd Banner - Technical only
« Reply #22 on: 2010-Jul-22 »
thats why i hide it automaticaly. it will be shown if the ad was loaded. then its clickable.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: iAd Banner - Technical only
« Reply #23 on: 2010-Jul-22 »
I don't see any test ad images at the moment, just he frame with iAd logo. Should I be seeing the test ad as it does seem to load it?

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: iAd Banner - Technical only
« Reply #24 on: 2010-Jul-22 »
you need to have wifi on
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: iAd Banner - Technical only
« Reply #25 on: 2010-Jul-22 »
I am on WiFi! Are you getting test ads?

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: iAd Banner - Technical only
« Reply #26 on: 2010-Jul-22 »
not tested last days, but before i got the Apple Test Add and on click i got the Voila it works thing ;)
if the iAd frame is shown, iAd works fine, but not receiving the Ad from apple i think.

MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1540
    • View Profile
Re: iAd Banner - Technical only
« Reply #27 on: 2010-Jul-22 »
Yeah I'll try it some other time again as the frame is working fine.  :booze:

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: iAd Banner - Technical only
« Reply #28 on: 2010-Jul-22 »
perfect :D
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline baicskillet

  • Mc. Print
  • *
  • Posts: 29
    • View Profile
Re: iAd Banner - Technical only
« Reply #29 on: 2010-Jul-22 »
baicskillet, add the existing framework and lib in xcode!
trucidare, I tried out the lib and the result was I there was mousestate feedback and the banner frame slides nicely.
Although there is no advert text or image in the banner test frame (server issue), there now is no response when tapping the advert.

Code: GLBasic [Select]
//iAd Banner Lib Test
//undelcared variables are psuedo

IMPORT "C" void GLB_iAd()
IMPORT "C" void GLB_iAd_Hide() // to hide the banner
IMPORT "C" void GLB_iAd_Show() // to show banner after hide

GLB_iAd()
WHILE TRUE
        if time_to_show
                GLB_iAd_Show()
        elseif time_to_hide
                GLB_iAd_Hide()
        endif
        PRINT banner_state,0,0
        SHOWSCREEN
WEND
 

Yeah, I figured that out on xcode. I added that iad .a file to the lib folder in glbasic too.  Is that routine in your post for displaying and hiding the ads? It only has GLB_iAd_Hide, GLB_iAd_Show and GLB_iAd.  There's no GLB_iAd_Init.
« Last Edit: 2010-Jul-22 by baicskillet »