facebook publishInstall is NOT working on Android

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

Here is my AndroidManfifest.xml.  There was no strings.xml in my apk.  

FYI, Facebook is now showing I only have around 35% of the daily actives that I did since I published with 3012.  I just checked and I have roughly 35% of my user base on Android 6 - Is this coincidental or does it narrow down what the issue could be?

\<?xml version="1.0" encoding="utf-8"?\> \<manifest xmlns:android=http://schemas.android.com/apk/res/android versionCode="1390" versionName="1.39" installLocation="0" package="com.spheregamestudios.designercity" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415"\> \<uses-sdk minSdkVersion="15" targetSdkVersion="23"/\> \<uses-permission name="com.android.vending.BILLING"/\> \<uses-permission name="android.permission.INTERNET"/\> \<uses-permission name="android.permission.WRITE\_EXTERNAL\_STORAGE"/\> \<uses-permission name="android.permission.ACCESS\_NETWORK\_STATE"/\> \<uses-feature glEsVersion="131072"/\> \<uses-feature name="android.hardware.telephony" required="0"/\>\<uses-feature name="android.hardware.screen.portrait" required="0"/\>\<uses-feature name="android.hardware.screen.landscape" required="-1"/\> \<application label="DesignerCity" icon="2130903040" name="android.support.multidex.MultiDexApplication" hardwareAccelerated="-1" largeHeap="-1" banner="2130837580"\> \<meta-data name="targetedAppStore" value="google"/\> \<meta-data name="com.facebook.sdk.ApplicationId" value="508028766008532"/\> \<activity theme="16973831" label="DesignerCity" name="com.ansca.corona.CoronaActivity" launchMode="2" screenOrientation="6" configChanges="1264"\> \<meta-data name="requestedDefaultOrientation" value="sensorLandscape"/\>\<intent-filter\> \<action name="android.intent.action.MAIN"/\>\<category name="android.intent.category.LAUNCHER"/\>\</intent-filter\> \</activity\> \<activity theme="16973831" name="com.ansca.corona.CameraActivity" screenOrientation="1" configChanges="1184"/\> \<activity theme="16973831" name="com.ansca.corona.VideoActivity" configChanges="1264"/\> \<activity theme="16973831" name="com.ansca.corona.purchasing.StoreActivity" configChanges="1184"/\> \<provider name="com.ansca.corona.storage.FileContentProvider" exported="-1" authorities="com.spheregamestudios.designercity.files"/\> \<service name="com.ansca.corona.CoronaService"/\> \<receiver name="com.ansca.corona.SystemStartupBroadcastReceiver"\> \<intent-filter\> \<action name="android.intent.action.BOOT\_COMPLETED"/\> \</intent-filter\> \</receiver\> \<receiver name="com.ansca.corona.notifications.AlarmManagerBroadcastReceiver"/\> \<receiver name="com.ansca.corona.notifications.StatusBarBroadcastReceiver"/\> \<receiver name="com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver" permission="com.google.android.c2dm.permission.SEND"\> \<intent-filter\> \<action name="com.google.android.c2dm.intent.RECEIVE"/\> \<action name="com.google.android.c2dm.intent.REGISTRATION"/\> \<category name="com.spheregamestudios.designercity"/\> \</intent-filter\> \</receiver\> \<service name="com.vungle.publisher.VungleService" exported="0"/\> \<activity theme="16973840" name="com.facebook.FacebookActivity" configChanges="1456"/\> \<activity theme="16973831" name="plugin.facebook.v4.FacebookFragmentActivity" configChanges="1184"/\> \<activity theme="16973831" name="com.vungle.publisher.VideoFullScreenAdActivity" configChanges="1073745919"/\> \<activity theme="16973841" name="com.vungle.publisher.MraidFullScreenAdActivity" configChanges="1184"/\> \</application\> \</manifest\>

Looking at the release notes, there are a couple of things that might be impacting this.

  1. In Build 3005, we turned on our Android Plugin dependency system so that plugins would place nice with each other. While I doubt this has any impact, it is a change.  

  2. In Build 3009, we changed our minimum Android SDK to 4.0.1. 

So you could either try dropping back to build 3007 and see if that helps or drop back before 3005 and rule out those changes. 

I’ll bring this up with Engineering. They are likely going to want a bug report including a test case that can reproduce the problem.

Rob

Question: You say you’re seeing different stats using Google Analytics. I don’t see that plugin in your build.settings. How are you collecting these GA stats?

Rob

I’ll be pushing an update early next week so I’ll wait and see what engineering say before using an older build to publish with.   It does seem to be only Android 6 installs (from my figures) that are being recorded on Facebook.  My minSdkVersion=“15” so it probably isn’t the build 3009 changes.  Most likely the plugin dependency changes.

Thanks for looking into this for me.

Edit: Regarding GA, I use this https://code.coronalabs.com/code/google-analytics-module.  I also have a MySQL back-end server that tracks game activity,  The figures from my DB roughly match GA figures.

Can you also explain to me (and the engineers) how you’re using .publishInstall(). It just reports to Facebook the first time someone installs an app. Normally it would be used in advertising situations but I don’t see any ad plugins in your build.settings.  I guess it might be important for getting friends lists who have the app installed. But how are your and your app using this data? Is it just an analytics point? Are you using attribution to purchase advertising to increase your user base?

Rob

I did use FB ads until Aug 16.  I am looking to do further campaigns this year so I will need to be able to attribute an install to an ad to get accurate CPI’s. 

I allow users to sync their game across multiple devices and I use FB for that and users can also visit their FB friend’s that are playing the game.

It is also very useful for demographics and user profiling.