setting loc & hide inneractive ad

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

setting loc & hide inneractive ad

Post by Jellobus » Tue Feb 04, 2014 9:49 am

Hello, everyone!

I am newbie here and its my first post. Hope I could get some leads from your idea. :D

I am trying to implement inneractive Banner and fullScreen Ad on my App.

There are three things I like to know, :roll:

The stack uses fullscreenmode to “exactfit” (390x690)

1. How to hide “full screen” ad? so that it will be pre-loaded and will show to users on right time without delay. I tried with “mobileAdSetVisible, false” command. It works with “banner” but not with “full screen” ad. If there is trick to do this, please advice…

2. Regarding to setting location of banner Ad, I like to set loc of banner Ad to the bottom of the all screen sizes. I am using set the fullscreenmode to “exactfit” I found the loc of banner ad is not exactly re-calculated with fullscreenmode setting.

The stack will be resized when it launches on mobile device. The thing is 1. I can't know the height of banner. The height of banner changes depends on the mobile screen resolution and it varies form 50 to 75 as far as I know... 2. Do not know how to find the height of device screen..I tried with screenRect but didn't give right number.. may be there's some error..

3. How can I place a banner ad on desired location regardless of screen size?

For example, the stack size is 390x690, and there is an image on topleft 0, 400. Now I like to set topleft of ad to 0,400 so that the image is completely covered by the banner Ad.

I spent many days to figure it out but had no progress….If there are anyone having an idea please share.

Thanks for sharing your time with this topic! :wink:


Louis

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: setting loc & hide inneractive ad

Post by Simon » Tue Feb 04, 2014 8:24 pm

Hi Louis,
Welcome to the forum :)

I'm just going to start with the low hanging fruit;
For example, the stack size is 390x690, and there is an image on topleft 0, 400. Now I like to set topleft of ad to 0,400 so that the image is completely covered by the banner Ad.

Code: Select all

put the loc of image 1 into tPos
set the loc of img (?) "banner ad" to tPos
That way no matter where the image is the banner will show up (you can use topLeft as well).

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

Re: setting loc & hide inneractive ad

Post by Jellobus » Wed Feb 05, 2014 3:16 am

Oh ho ho! Thanks Simon! :mrgreen:
It was so simple but I never though that way until you told me.

so I think problem 2 and 3 are solved. I still thinking some way to hide or pre-caching "full screen" Ad. I read through developer's page on inneractive website and found that pre-caching interstitial Ad is available with their SDK. The SDK is integrated into livecode so livecode developer can't set this function I believe.. but I believe there is way to mimic pre-caching full screen ad. Just I want to hide "full screen" Ad until the I decide to show it to users...

Anyway thanks a lot for your great advice! :D


Louis

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

Re: setting loc & hide inneractive ad

Post by Jellobus » Wed Feb 05, 2014 11:28 am

Simon,

I tried with your method.. I set the loc, topleft of both banner and image "image" to same 0, 200, but the banner placed unexpected loc. It must be something with fullscreenmode function. I have to figure it out.

cheers,

Louis

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: setting loc & hide inneractive ad

Post by Simon » Wed Feb 05, 2014 6:52 pm

Hi Louis,
If the objects are the same size then it should be working.
What happens when you don't use fullScreenMode?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Jellobus
Posts: 317
Joined: Tue Dec 10, 2013 2:53 pm

Re: setting loc & hide inneractive ad

Post by Jellobus » Thu Feb 06, 2014 9:00 am

Hi Simon,

This is my script

Code: Select all


---in the stack script---
on preopenstack
   set the fullscreenmode of this stack to "exactfit"
end preopenstack

---in the card script---
global tPos, yAdloc

on openCard
   put the topleft of image "AdHere" into tPos
   put item 2 of tPos into yAdloc
   createAd
end openCard

command createAd
   local tBDetails  
   mobileAdRegister "ID_Here"
   put "30" into tBDetails["refresh"] // The advert refresh interval in seconds
   put 15-34 into tBDetails["age"] // The age of the target audience
   put "female" into tBDetails["gender"] // The expected gender of the target audience
   mobileAdCreate "myAd", "banner", (0,yadLoc), tBDetails
   mobileAdSetVisible "myAd", true// Sets the visible of the ad "myAd" to true
end createAd
I found that this method is not valid for both conditions in which fullscreenmode is set to true or false with LC 6.5.2
with LC6.1.3 however, I can set desired loc of banner ad by

put the height of this card into tHeight
put tHeight-75 into yloc
(I assume the height of banner is 75, but it can be 50 depends on the screen resolution)
then create ad with ----mobileAdCreate "myAd", "banner", (0,yloc), tBDetails
---> Ad will be placed on the bottom of the screen yet the result won't be consistant..

any other ways?

Cheers,


Louis

Post Reply