I updated to the newest version of Corona Cards and now I get the following error…any ideas what is going on?
Error 1 Exception from HRESULT: 0x89721800 0 0
Now this is happening to all of my projects which were fine before!
I updated to the newest version of Corona Cards and now I get the following error…any ideas what is going on?
Error 1 Exception from HRESULT: 0x89721800 0 0
Now this is happening to all of my projects which were fine before!
How can determine if an ad has been show on the LUA side of things?
I’m not sure what that exception means but your best bet in tracking down the problem would be to do like I said before and set breakpoints throughout various parts of your code and step through using the debugger to see if you can catch the problem code.
For your second question, do you mean you want admob to notify you in lua when an ad as been shown or you want to call a lua method and check to see if an ad has been shown?
The former you would need to setup a LUA listener as described in this guide: http://docs.coronalabs.com/daily/coronacards/wp8/communication.html
The latter you can just add another C# listener like the other ones you setup in the tutorial and have it return true if admob showed an ad or false if not.
I was talking about the second way.
It would be awesome if you could include the code examples for determining if an ad had shown in your tutorial. I have never programmed in C# so I would be very thankful if you could add it to the tutorial.
@SpaceWolf – thanks a lot for this code. It works beautifully. I sincerely appreciate your help. Thanks again.
Is it possible to port this tutorial to banner ads? I could really use a step by step tutorial like that.
First, thank you for this great tutorial.
Looking at the code, everything seems clear but this:
local widget = require("widget") local preloadAdButton = widget.newButton{ label="Preload Ad", labelColor = { default={1,0,0}, over={0,1,0} }, fontSize = 32, width=200, height=50, onRelease = preloadAdButton\_onReleaseListener, x = display.contentCenterX, y = display.contentCenterY + 100, }
When you press the button, the LUA preloadAdButton_onReleaseListener is called.
Where is the code for this listener?
It’s calling a C# method in the “MainPage.xaml.cs” file. Since Google’s Ads library is a .NET library, a Lua/.NET bridge needs to be coded to communicate between the 2 languages. This is what @spacewolf is demonstrating.
You should have a look at our documentation in the link below for a quick explanation of how it works. It’s pretty easy to set up and it opens up a lot of options for you.
http://docs.coronalabs.com/daily/coronacards/wp8/communication.html
To answer myself, to call the C# you need something like this:
local function adInterstitialShow()
local result = Runtime:dispatchEvent({ name = “Native_ShowInterstitialAd” });
end
@SpaceWolf – thanks a lot for this code. It works beautifully. I sincerely appreciate your help. Thanks again.
Is it possible to port this tutorial to banner ads? I could really use a step by step tutorial like that.
How to use your code with Visual Basic? All wp8 files created by project have Visual Basic’s .vb extension not C#'s .cs, for e.g. MainPage.xaml.vb. Help please
The code I have provided is C# code not Visual Basic. I’m pretty sure CoronaCards only works with C# as well since their project template is in C#.
Why do you want to use Visual Basic?
We actually do provide a VB.NET WP8 CoronaCards project template.
When providing .NET project templates, it’s considered good practice to provide templates for both C# and VB.NET since those are the most popular.NET languages. Although, in my opinion, C# is the dominant .NET language and it’s in your best interest to learn it
You’ll need to convert and integrate @spacewolf’s C# code to your VB.NET project yourself. It’s not difficult. Other than syntax, the features supported by the 2 languages are very similar. The only striking difference is event handling, but in my opinion (and it might sound blasphemous), VB.NET’s event handling is actually better than C#'s. You’ll be using syntax such as AddHandler and RemoveHandler keywords instead of C#'s += and -= respectively. And you can explicitly designate a method as an event handler via the “Handles” keyword. VB.NET’s syntax, while more verbose, makes it more obvious how the code works and uses really software terms for its keywords such as “Inherits”, “Implements”, “Handles”, etc. That aspect of the language is kind of nice.
The link for the tutorial is broken 404
Anyone got the backup?
thanks
Sorry about that! I switched hosting providers and am trying to extract the tutorial off the old one so I can put it up again.
Edit: The link should be working again!
nice… thanks spacewolf!
First, thank you for this great tutorial.
Looking at the code, everything seems clear but this:
local widget = require("widget") local preloadAdButton = widget.newButton{ label="Preload Ad", labelColor = { default={1,0,0}, over={0,1,0} }, fontSize = 32, width=200, height=50, onRelease = preloadAdButton\_onReleaseListener, x = display.contentCenterX, y = display.contentCenterY + 100, }
When you press the button, the LUA preloadAdButton_onReleaseListener is called.
Where is the code for this listener?
It’s calling a C# method in the “MainPage.xaml.cs” file. Since Google’s Ads library is a .NET library, a Lua/.NET bridge needs to be coded to communicate between the 2 languages. This is what @spacewolf is demonstrating.
You should have a look at our documentation in the link below for a quick explanation of how it works. It’s pretty easy to set up and it opens up a lot of options for you.
http://docs.coronalabs.com/daily/coronacards/wp8/communication.html