Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

facebook publishInstall is NOT working on Android
Started by Chinta @ Bit Craft Studios Dec 16 2016 05:11 PM

25 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Chinta @ Bit Craft Studios

[GLOBAL: userInfoPane.html]
Chinta @ Bit Craft Studios
  • Observer

  • 19 posts
  • Corona SDK

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
 


[TOPIC: post.html]
#2

Ajay McCaleb

[GLOBAL: userInfoPane.html]
Ajay McCaleb
  • Contributor

  • 209 posts
  • Corona Staff

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.



[TOPIC: post.html]
#3

Chinta @ Bit Craft Studios

[GLOBAL: userInfoPane.html]
Chinta @ Bit Craft Studios
  • Observer

  • 19 posts
  • Corona SDK

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?



[TOPIC: post.html]
#4

Ajay McCaleb

[GLOBAL: userInfoPane.html]
Ajay McCaleb
  • Contributor

  • 209 posts
  • Corona Staff

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.



[TOPIC: post.html]
#5

Chinta @ Bit Craft Studios

[GLOBAL: userInfoPane.html]
Chinta @ Bit Craft Studios
  • Observer

  • 19 posts
  • Corona SDK

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 !



[TOPIC: post.html]
#6

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,083 posts
  • Corona SDK

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",
		},
     
  }, 


[TOPIC: post.html]
#7

Chinta @ Bit Craft Studios

[GLOBAL: userInfoPane.html]
Chinta @ Bit Craft Studios
  • Observer

  • 19 posts
  • Corona SDK

Thanks @agramonte. I will try the build 3011.

 
  •  


[TOPIC: post.html]
#8

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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.

 
  

 



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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

 

Rob



[TOPIC: post.html]
#10

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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



[TOPIC: post.html]
#12

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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()



[TOPIC: post.html]
#13

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

Your best bet might be to file a bug report.

 

Rob



[TOPIC: post.html]
#14

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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



[TOPIC: post.html]
#15

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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



[TOPIC: post.html]
#16

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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.



[TOPIC: post.html]
#17

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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



[TOPIC: post.html]
#18

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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 }
        },       
    },
}


[TOPIC: post.html]
#19

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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?  



[TOPIC: post.html]
#20

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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



[TOPIC: post.html]
#21

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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>


[TOPIC: post.html]
#22

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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



[TOPIC: post.html]
#23

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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



[TOPIC: post.html]
#24

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,013 posts
  • Corona SDK

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.


Edited by adrianm, 26 January 2017 - 07:57 AM.


[TOPIC: post.html]
#25

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,535 posts
  • Enterprise

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




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]