facebook publishInstall is NOT working on Android

I am using Facebook.v4 plugin & latest corona public release.

publishInstall() is working without any issues on iOS, but not working on Android - Facebook developer account is not showing the installs on android.

Does any one see this problem ? Or, is it just me? 

By the way, this used to work before on Android. So, I am wondering if something has changed in the last month or two.

Thanks,

Chinta

Hi Chinta,

We now provide a versioning/upgrade guide with details on what’s changed between different versions of the Facebook plugin. There were some changes made to the implementation of publishInstall() under the hood in that time frame you mentioned. You might consider experimenting with the different versions of the Facebook plugin to help isolate down what sounds like a regression.

Thanks for the reply Ajay. 

Could you give me more details on how to change the versions of the Facebook plugin ? I am using facebook.v4 plugin. Are there any other or recent facebook plugins than v4?

The version of the Facebook v4 plugin that will be built into your app depends on what daily build of Corona you are using. For example, if you wanted to use the “3/2016 update” version of the plugin, you would need to use any daily build between 2015.2828 and 2016.2931 of Corona. You can grab these daily builds from our page here.

Also, Facebook-v4 is the most recent Facebook plugin we have. Should Facebook decide to rewrite their SDKs again, then you may see a Facebook-v5 plugin in the future.

Thanks for the reply Ajay. I have tried the build 2929, but still the install did not show up in the Facebook dashboard.

This is very important to our release as we have planned Facebook app install ads as part of our marketing campaign.

So any help with this is highly appreciated !

I just built an app and do not have this issue. I see my test app install from yesterday. I have the KeyHash filled in. I also have this in the class name:

com.ansca.corona.CoronaActivity

Using corona: 3011

And this is my plug-in build settings:

plugins = { ["plugin.appodeal"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true, appletvos=true } }, ["plugin.facebook.v4"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true } }, ["plugin.bit"] = { publisherId = "com.coronalabs", }, ["plugin.openssl"] = { publisherId = "com.coronalabs", }, },

Thanks @agramonte. I will try the build 3011.

I can agree with this…  since publishing (Jan 10th) with 3012 I’ve seen a noticeable drop off in FB reporting - like 50+%.

Apparently my daily actives have gone from 20k to 9k but Google analytics strongly disagrees and shows my current daily actives at 25k.

There is clearly something wrong in publishInstall().  Most of my traffic is Android.

  

Can you narrow down what build seems to be responsible for the change in behavior?

Rob

Hey Rob,

I can tell you I was building with 2911 for ages and finally moved to 3012.  The drop off with 3012 is very noticeable - see image below.  If that helps at all.  Maybe you can cross reference those builds with the Facebook v4 plugin builds?

Unfortunately, I would really piss off my players but pushing lots of releases out to find the Corona build that doesn’t exhibit this behaviour.  I can see that only Android is affected as iOS shows the growth continuing.

This is Android

2afa688.jpg

and this is iOS

34i21hs.png

Adrian

The last update to the Facebook plugin was on 12/7/2016. That chance was to the two .lua files that download to the Mac and Win simulators that say you can’t use them in the simulator. This update is in the time frame of daily builds 2999/3001 (but are not dependent on those). Before that the last thing that actually touched the plugin was 11/16/2016 which is in the 2992 (public build) range in time.

Build 2911 was from July 12, 2016 so we’ve had many changes since then. Can you install a release version and see if there is anything useful in the device’s console log?

Rob

Nothing eventful in logs on multiple devices.  Is there anything I can check to see if publishInstall() encountered an error?

All I do is call this in main.lua

local facebook = require ( "plugin.facebook.v4" ) facebook.publishInstall()

Your best bet might be to file a bug report.

Rob

I just did but I haven’t received an email or a case number?

In that case can you email it to support@coronalabs.com.

Just a thought… I’ve just looked at the docs and I’m not passing the appID to publishInstall()?

It is specified in the iphone and android sections of build.settings.  Could it be that a change to the Facebook plugin means it is no longer looking for appID in build.settings for android but still is for iphone?  That would explain why iOS is unaffected.

The publishInstall() API doesn’t take any parameters. We should be getting the AppID from build.settings. Can you please post your complete build.settings?

Thanks

Rob

That’s what I thought but the docs say otherwise (and it’s required too) - https://docs.coronalabs.com/plugin/facebook/publishInstall.html

settings = { splashScreen = { ios = { enable = true, image = "splash\_ios.png" }, android = { enable = true, image = "splash\_android.png" } }, orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft"}, }, iphone = { plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads = true, NSExceptionDomains = { ["spheregamestudios.com"] = { NSIncludesSubdomains = true, NSThirdPartyExceptionRequiresForwardSecrecy = false }, ["facebook.com"] = { NSIncludesSubdomains = true, NSThirdPartyExceptionRequiresForwardSecrecy = false }, }, }, LSApplicationQueriesSchemes = { "fbapi", "fbapi20130214", "fbapi20130410", "fbapi20130702", "fbapi20131010", "fbapi20131219", "fbapi20140410", "fbapi20140116", "fbapi20150313", "fbapi20150629", "fbXXXXXXXXXXXXXX", "fbauth", "fbauth2", "fb-messenger-api20140430", }, UIStatusBarHidden = true, UIPrerenderedIcon = true, UIApplicationExitsOnSuspend = false, CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-167.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", }, FacebookAppID = "508028766008532", CFBundleURLTypes = { { CFBundleURLSchemes = { "fb508028766008532", } } }, }, }, android = { versionCode = "1390", versionName = "1.39", usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", "com.android.vending.BILLING" }, facebookAppId = "508028766008532", largeHeap = true, minSdkVersion = "14", }, plugins = { ["plugin.facebook.v4"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true } }, ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, ["plugin.openssl"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true } }, ["plugin.notifications"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true } }, ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", supportedPlatforms = { iphone=true, android=true, ["android-kindle"]=true } }, ["plugin.amazon.iap"] = { publisherId = "com.coronalabs", supportedPlatforms = { ["android-kindle"]=true } }, }, }

build.settings seems fine to me.  The only change I’ve made is to add the splash screen settings for the new plugin.  

The Corona doc clearly states (well does now) that appID is a required parameter.  Any ideas on what might have changed Rob?  

I suspect that’s an error with the documentation. I’ve been looking through the code for the plugin and publishInstall() does not take a parameter on either Android or iOS. Based on the code review, iOS has to be reading it from a pList entry or from a combination of entries in AndroidManfifest.xml and strings.xml.

You could unzip your .apk file (it’s just a zip file) and look into strings.xml. You may need a tool to convert it from binary to something readable and make sure it’s being added correctly.

The population of those files happens at build time and the plugin isn’t involved.

Rob