distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

[InAppBilling] - Running compiled swf with ANE references crash #292

Closed moviestarplanet closed 9 years ago

moviestarplanet commented 9 years ago

We have a project that runs on IOS, Android and Web. We have one build for all the platforms, so we are packaging the APK, IPA and the SWF depending on where are we releasing.

We are using the InAppBilling library to handle the inApp purchases for IOS and Android. The game works fine on mobile but if we try to run the the game and try to run the code that refers to the ANE classes it crashes complaining about not founding a class, for example: Product and Purchase. We fixed the problem commenting any reference (imports) but it's not a final solution, we don't want to add any Compiler arguments to hide this code if we want to build a web release.

Any idea of what's wrong with the library, or it's my fault?

marchbold commented 9 years ago

Hi,

Can you let me know which class(es) in particular its complaining about and I'll double check these in the default library?

moviestarplanet commented 9 years ago

Product and Purchase. I'm not calling any method from the library because in web we don't show the shop, but just having the imports makes the game explodes :)

marchbold commented 9 years ago

Hi, Can you be more specific about the error as those classes are included in the default library? Are you packaging the extension with your application?

marchbold commented 9 years ago

Hi, I've just re-read your question and I think I've realised the problem. You're not creating an AIR application but a SWF to run in a browser?

In this case you'll need to extract the default SWC from the ANE and make sure you include it in your web build. To get the SWC you'll need by unzipping the ANE (you may have to rename it to .zip to do this on windows):

unzip com.distriqt.InAppBilling.ane

Then using the following file:

META-INF/ANE/default/distriqt.extension.inappbilling.default.swc

Let me know how you go with that

moviestarplanet commented 9 years ago

I changed my swc for the one that you told me:

but know he can't find:

InAppBillingServiceTypes.GOOGLE_PLAY_INAPP_BILLING