A Fuse Powered Company

Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Plugins 'Hell'
Started by efgames.net Aug 28 2013 01:04 PM

- - - - -
16 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

efgames.net

[GLOBAL: userInfoPane.html]
efgames.net
  • Pro
  • PipPipPipPipPipPip
  • 90 posts
  • Jedi

Hey guys,

So I have a feeling that this is not rigth: For each platform i need to change set of plagins(Amazon, GPGS) - to turn off all that i dont need for next build.

 

But on other hand - it is obvious - Plugin for GP should be ignored for iOS build.

 

Its not super-bug, but that something that bothers me.



[TOPIC: post.html]
#2

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Pro
  • PipPipPipPipPipPip
  • 995 posts
  • Jedi

I've noticed that too.  If I use iAds in my iOS version, I have to remove the plugin code from build.settings before building for Android, or the build will fail.

 

It would be nice if Corona simply ignored plugins listed in build.settings if the plugin doesn't exist for the platform the build is targeting.

 

- Andrew



[TOPIC: post.html]
#3

Stephen Lewis

[GLOBAL: userInfoPane.html]
Stephen Lewis
  • Pro
  • PipPipPipPipPipPip
  • 711 posts
  • Jedi

+ 1

 

-Stephen



[TOPIC: post.html]
#4

efgames.net

[GLOBAL: userInfoPane.html]
efgames.net
  • Pro
  • PipPipPipPipPipPip
  • 90 posts
  • Jedi

I've noticed that too.  If I use iAds in my iOS version, I have to remove the plugin code from build.settings before building for Android, or the build will fail.

 

It would be nice if Corona simply ignored plugins listed in build.settings if the plugin doesn't exist for the platform the build is targeting.

 

- Andrew

Andrew,

iads dosent need a special plugin:

 

options_ads_iads = (optionsBuild == "ios");

ext_ads = require "ads";

if(options_ads_iads)then
            ext_ads.init( "iads", "com.elitegamesltd.controlcraft", adListener);
    elseif(options_ads_inmobi)then
        if(optionsBuild == "ios")then
            ext_ads.init( "inmobi", "4028cbffXXXXXXXXXX5a470639");
        elseif(optionsBuild == "android")then
            ext_ads.init( "inmobi", "4028cbffXXXXXXXXXX5a470639");
        else
            options_ads_inmobi = false;
        end
    end
 
---------------------
just rule them out with IF =)


[TOPIC: post.html]
#5

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Pro
  • PipPipPipPipPipPip
  • 995 posts
  • Jedi

@efgames.net,

 

iAds (and the other networks) are all plugins, as described here: http://docs.coronalabs.com/guide/monetization/adSupport/index.html

 

If you're using an older build, you might still able to use iAds not as a plugin, but when it was built into the Corona core.  But now, it's only accessible as a plugin.

 

- Andrew



[TOPIC: post.html]
#6

Tom

[GLOBAL: userInfoPane.html]
Tom
  • Corona Staff
  • 1,398 posts
  • Jedi

You can add the following in build.setting to control which platforms include the plugin. You still need to add conditional code in you main.lua so you only require the proper plugin for the current platform:

 

settings =
{
    plugins =
    {
        -- key is the name passed to Lua's 'require()'
        ["CoronaProvider.ads.iads"] =
        {
            -- required
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone = true },
        },
    },
}

 

The following platforms are supported: iphone, android, android-kindle, android-nook

You need to list all the platforms supported and leave out the ones not supported. Setting the platform to false does not work at this time.



[TOPIC: post.html]
#7

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Pro
  • PipPipPipPipPipPip
  • 995 posts
  • Jedi

Thanks Tom, that's helpful.  Is the supportedPlatforms key documented anywhere?

 

- Andrew



[TOPIC: post.html]
#8

Stephen Lewis

[GLOBAL: userInfoPane.html]
Stephen Lewis
  • Pro
  • PipPipPipPipPipPip
  • 711 posts
  • Jedi

I'm not understanding how supportedPlatforms is supposed to work.  I tried this in the first part of my plugins settings

 

 

settings =
{
    plugins = 
    {
        ["plugin.amazon.iap"] = { publisherId = "com.amazon", supportedPlatforms = { android-kindle = "true" },},
        ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true },},
        ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", },
        ["plugin.carrot"] = { publisherId = "com.gocarrot", },
    },
 

 

 

but if I attempt to build for a device I get an error message popup "There is an error in your build.settings."  and the console says "Syntax error: .../build.settings:5: '}' expected near '=' "  but I don't see the syntax error.  Is supportedPlatforms supposed to work for all plugins?

 

-Stephen



[TOPIC: post.html]
#9

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Pro
  • PipPipPipPipPipPip
  • 995 posts
  • Jedi

If you post your full build.settings, perhaps we could help spot the error.

 

I just tried supportedPlatforms for the iAds plugin, and it worked for me.

 

- Andrew



[TOPIC: post.html]
#10

Stephen Lewis

[GLOBAL: userInfoPane.html]
Stephen Lewis
  • Pro
  • PipPipPipPipPipPip
  • 711 posts
  • Jedi

I tried building without the supportedPlatforms on the Amazon plugin and there was no syntax error.  I still had it enabled for the google gameNetwork and Vungle plugins so I guess it doesn't work for Amazon plugin, which is still in beta test.  

 

But I hope it will eventually work for the Amazon plugin as well since that is one of the ones I have to manually comment out of build settings if I'm not building specifically for Kindle.

 

(I know in the sample above I had the "true" in ...android-kindle = true... surrounded by quotes, but that wasn't the issue.  That was just me trying various things to get it to work and I cut and paste that version here.  Both ways produced the syntax error with the Amazon plugin)



[TOPIC: post.html]
#11

efgames.net

[GLOBAL: userInfoPane.html]
efgames.net
  • Pro
  • PipPipPipPipPipPip
  • 90 posts
  • Jedi

I tried building without the supportedPlatforms on the Amazon plugin and there was no syntax error.  I still had it enabled for the google gameNetwork and Vungle plugins so I guess it doesn't work for Amazon plugin, which is still in beta test.  

 

But I hope it will eventually work for the Amazon plugin as well since that is one of the ones I have to manually comment out of build settings if I'm not building specifically for Kindle.

 

(I know in the sample above I had the "true" in ...android-kindle = true... surrounded by quotes, but that wasn't the issue.  That was just me trying various things to get it to work and I cut and paste that version here.  Both ways produced the syntax error with the Amazon plugin)

Yes, this looks like a error:

supportedPlatforms = { android-kindle = true }

name of variable is with "-" - that is definetly a mistake =(

 

Can Tom fix it in his post? maybe there should be different names? like "android_kindle"?



[TOPIC: post.html]
#12

Tom

[GLOBAL: userInfoPane.html]
Tom
  • Corona Staff
  • 1,398 posts
  • Jedi

Yes, we looked into this and the server is getting hung up on the dashes in the key. Try the following:

supportedPlatforms = { "android-kindle" = true }



[TOPIC: post.html]
#13

aukStudios

[GLOBAL: userInfoPane.html]
aukStudios
  • Pro
  • PipPipPipPipPipPip
  • 995 posts
  • Jedi

Tom, wouldn't the more likely fix be this?

supportedPlatforms = { ["android-kindle"] = true }

 

You'd need brackets around a string key that has special characters.

 

- Andrew



[TOPIC: post.html]
#14

Tom

[GLOBAL: userInfoPane.html]
Tom
  • Corona Staff
  • 1,398 posts
  • Jedi

@Andrew, yes you're right. Thanks.



[TOPIC: post.html]
#15

akao

[GLOBAL: userInfoPane.html]
akao
  • Enterprise
  • PipPipPipPipPipPip
  • 236 posts
  • Jedi

@Tom -

 

I want to clarify when you say the supported platforms include android-kindle. Does that mean the plug-in will be included when, during the compile process, you target the "Amazon" store? Or, does it mean at run time, the app will try to detect if you are on a Kindle Fire, and if you are, then include the plug-in? (This is a potential problem for the Amazon market since that market could be downloaded onto none-Kindle Fire devices)

 

I am assuming it's the first, (it is build.settings, after all) but want to confirm.



[TOPIC: post.html]
#16

efgames.net

[GLOBAL: userInfoPane.html]
efgames.net
  • Pro
  • PipPipPipPipPipPip
  • 90 posts
  • Jedi

And how to include Samsung?

Any docs/info about supportedPlatforms more then this thread?



[TOPIC: post.html]
#17

seanh

[GLOBAL: userInfoPane.html]
seanh
  • Corona Staff
  • 241 posts
  • Plumber

And how to include Samsung?

Any docs/info about supportedPlatforms more then this thread?

 

iphone

iphone-sim

android

android-nook

android-kindle

 

Those are the only "platforms" that are currently recognized via this system. If you're targeting samsung android devices just use the android key if you're using a plugin that is android only.




[topic_controls]
[/topic_controls]