Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Ads on Phone 8
Started by doubleslashdesign Aug 25 2014 08:20 AM

61 replies to this topic
ads for windows 8 phone
[TOPIC CONTROLS]
Page 1 of 3 1 2 3
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

Just a Quick Question on Phone Ads

 

For ads on Windows Phone 8 and 8.1 ( using Corona Cards ) is the preferred method to just use Microsoft's Ad API?

 

Or Is corona looking to add the ( Corona Ads system )

 

Thanks

 

Larry Meadows, Jr



[TOPIC: post.html]
#2

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Currently, we have no plans on adding ads support on WP8.  At least in the next several months.  We're more focused on polishing up our core features right now.  For example, we're in the middle of adding support for our Lua "network" library for async http communications.

 

But you should be able to easily implement ad support for yourself via C#.  Microsoft's ad library is pretty simple to use.  And we have an example on how to communicate between Lua and .NET (link below) so that you can show/hide ads via Lua.

   http://docs.coronalabs.com/daily/coronacards/wp8/index.html#lua-interop-communications

 

If you need help, just let me know.  Although I've seen that you've already implemented in-app purchase, so, you might already be an expert in Lua/.NET bridging now.  :)



[TOPIC: post.html]
#3

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

Not a problem, that is just what I expected.

 

When I am done getting the kinks of my app then I'll create a sample APP and post the code :)

 

Larry



[TOPIC: post.html]
#4

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

You posting some sample code would be greatly appreciated!

 

If you have anything blocking you or features needed in the near future, then please let us know.  It'll help us prioritize what we need to work on next.  Thanks!



[TOPIC: post.html]
#5

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

Very nice thanks, yeah when I get that far I'll let you know.

 

Larry



[TOPIC: post.html]
#6

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

I am walking Throuhgh the Windows Phone 8.1 Ads tutorial to create a sample app.

 

the tutorial says I need a Package.appxmanifest file....

 

Add the Internet (Client & Server) Capability to the Package.appxmanifest. In Solution Explorer, double click

Package.appxmanifest.

 

the Corona Extension did not create one by default is there a reason for this?

 

Here is the link

http://msdn.microsoft.com/en-US/library/advertising-mobile-windows-phone-ads-walkthroughs-81-silverlight-markup%28v=msads.20%29.aspx

 

 

Thanks

 

Larry



[TOPIC: post.html]
#7

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

You need to follow the instruction for 8.0, not 8.1.  Have a look at this...

   http://msdn.microsoft.com/en-US/library/advertising-mobile-windows-phone-ads-walkthroughs-8-silverlight-markup(v=msads.20).aspx

 

8.0 uses a "WMAppManifest.xml" file instead, which the above links tells you how to modify.



[TOPIC: post.html]
#8

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

I have just successfully got admob interstitial working. Its a little buggy though.



[TOPIC: post.html]
#9

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

BTW I have tried some ad methods.

I cant figure out Admob banner yet as the guide Google gives seems incorrect as it asks to look for an adView in the toolbox and its not there or doesnt seem to be included in the latest dll. I will come back to this later.

 

Admob Interstitial work but they seem to exit the app and not suspend so this is okay on boot but if you fire it up, it will exit and re launch the app. It is the same as if you had "exit on suspend" on the build settings set to true. Admob  Interstitial  usually suspend on Android but on Windows it exits and relaunches and if you were halfway through gameplay this will obviously reset unless you had some boot check to reload exact status of game (a pain). Anyway this is fine on boot up only.

 

I have also got Windows pub center ads banner working too. It works pretty well apart form some topics dont seem to fit in the window properly. I have even created more than one instances of a banner.



[TOPIC: post.html]
#10

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Hmmm... interesting.

 

In my testing, I've noticed that if you navigate to another XAML page within your own app, it actually "unloads" the previous page and all of its XAML controls, which would include the CoronaPanel XAML control.  Our CoronaPanel control is set up to terminate (ie: applicationExit) the Corona runtime when the control has been unloaded.  So, I'm thinking that the AdMob interstitial ad must be hosted in its own XAML page.  That's probably what's going on.  The problem is that we need that "Unloaded" event in order to tell if your are backing out of the app or removing the control from the page.

 

I'll see about looking into a solution for this next week.  Ideally, Corona should not raise an "applicationExit" when navigating to another page, such as an interstitial AdMob ad.  (Ideally, Microsfot's XAML shouldn't unload the previous page and controls when navigating to another page too, but it is what it is.)



[TOPIC: post.html]
#11

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

That's the right thing to do.  We've designed our CoronaPanel control to be a container for other controls so that we could someday add native TextBox, WebView, Maps, and AdBanner support in the future.  Feel free to take advantage of it.

 

But that said, I'm pretty sure that the AdMob library is display an interstitial ad as a separate page.  Which means it doesn't matter where you position it in your page.  I think the position you put it in your page only matters for ad banners.

 

Also, my understanding is that Microsoft's interstitial ads are not displayed on a separate page.  But I'm guessing that AdMob has much more inventory for different regions which is the advantage on using it.



[TOPIC: post.html]
#12

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

Sorry. I realised I copied in the windows banner ad markup not the admob one. I will look at this layer and see if I can place the admob one in there. I deleted then realised you had just replied. Sorry



[TOPIC: post.html]
#13

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

Oh and I mentioned before but I couldn't see the adView component from google ads.dll file. In the docs you on,y get that control for admob banners, with the interstial I have to "use" the dll and instance the class and invoke it with the id. I can't do much else with it. I have tried bringing up the ad without creating another class but it doesn't work so I think it removes itself.

[TOPIC: post.html]
#14

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Rob,

 

We have a new version of CoronaCards that we'll be sending out soon that resolves the AdMob interstitial ad issue.  Corona will now correctly suspend when displaying an interstitial ad and resume (instead of restarting) when backing out of the ad.  Thanks for bringing this issue up.



[TOPIC: post.html]
#15

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

Great news Joshua. This week you lot have added some handy bits and bobs. Nice one!



[TOPIC: post.html]
#16

spacewolf

[GLOBAL: userInfoPane.html]
spacewolf
  • Contributor

  • 298 posts
  • Enterprise

@doubleslashdesign were you able to get the ad coding working correctly? I'm very interested in seeing the sample code :)



[TOPIC: post.html]
#17

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

I was able to get it to working last Monday.  I modified Google's AdMob C# interstitial ad sample project to run Corona and confirmed that it could fetch/display an ad and then resume Corona.  You'll need build #2449 to do it  Rob, I hope it worked out for you too.

 

spacewolf, I was using Google's AdMob library provided here...

   https://developers.google.com/mobile-ads-sdk/download



[TOPIC: post.html]
#18

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

I haven't used the update yet but I did have admob and windows banners working, it all went rather easily considering I've never used visual studio until a month ago :) I didn't mind the interstertials only on boot anyway as that's the important one. I will report back next week when I try a new port.

[TOPIC: post.html]
#19

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

@spacewolf I did get a simple version of the windows 8 ads working. it was very easy.

 

I'll spend some time to get the ad working in my corona sample template, it should be pretty easy.

 

Luck for me with the new Corona update navigation away and back to the app should be fixed with pause and resume, so this could be pretty cool.

 

I'll post the code after I get it working.

 

Larry



[TOPIC: post.html]
#20

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

I am very close on this now. I added the Microsoft Windows Ads into my sample corona project.

 

everything is coming up on my screen. But I have the following issues.

 

1) I don't see the ads ( i think this has something to do with my Grid layout - I am not sure yet )

2) with the ad code in place I can no longer touch the actual corona screen for some reason.

 

i will continue to monkey around with it.



[TOPIC: post.html]
#21

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

Here is mine. You can  copy past it if you like. Make sure  that you can see the new view you add in your grid layout view. it might be off screen. Change your positioning as you need it. This is currently set for middle bottom. 

  <DrawingSurfaceBackgroundGrid x:Name="fDrawingSurfaceBackgroundGrid" Grid.Row="1" Margin="12,0,12,0">
        <corona:CoronaPanel x:Name="fCoronaPanel">
            <UI:AdControl x:Name="ad1"
                          ApplicationId="LALALA not telling you"
                          AdUnitId="or this either"
                          HorizontalAlignment="Center" 
                          Height="60" 
                          Margin="-0,-10,0,0" 
                          VerticalAlignment="Bottom" 
                          Width="320" 
                          IsAutoCollapseEnabled="True"/>
        </corona:CoronaPanel>
 
    </DrawingSurfaceBackgroundGrid>


[TOPIC: post.html]
#22

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

IF you cant see ads. make sure you put back the default ids so you see the test ad on simulator. if you see test ad but not actual ads then campaign is not on. if you dont see test ad then its either off screen or you might have placed it outside the main grid object



[TOPIC: post.html]
#23

doubleslashdesign

[GLOBAL: userInfoPane.html]
doubleslashdesign
  • Contributor

  • 727 posts
  • Corona SDK

@Rob,

 

That got it.

I did not think to place the Ad control inside the CoronaPanel. I had created a stack panel and was trying to get that to work.

 

But your way is better. On my little laptop the simulator went nuts flickering on every frame, but on the divice its smooth.

 

i added some funky code to toggle the ads on an off, with the Lua dispatch events but it is all working pretty well.

 

@SpaceWolf

Let me clean up my code a bit and I'll upload it to my website. I'll try to tackle this on tuesday evening.

 

 

Thanks for the assist Rob and everyone else.

 

Larry



[TOPIC: post.html]
#24

spacewolf

[GLOBAL: userInfoPane.html]
spacewolf
  • Contributor

  • 298 posts
  • Enterprise

Great news @doubleslashdesign!

 

I am looking forward to seeing the ad sample codes :)



[TOPIC: post.html]
#25

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 329 posts
  • Corona SDK

Glad to help Larry. Notice on google docs they don't add "name" parameter. I tried this when I needed to hide/unhide it. Adding the name allowed this. Also added extra bits like auto collapses although this will remove the black square if no banner is available so might look like it's not working. Best to disable this till it's all working.


[topic_controls]
Page 1 of 3 1 2 3
 
[/topic_controls]