I'm using Facebook App Invites for Android. Everything works fine: I send an invitation, I receive it on the target device, I can install app from Google Play.
Now I want to pass the user's referrer code to Google Play. The idea is when my "friend" installs the app, he automatically has my referral code. I have my BroadcastReceiver that is catching Google campaign parameters.
I have a server-side script which generates a simple code like this :
<html>
<head>
<meta property="fb:app_id" content="<MY_APP_ID>">
<meta property="og:title" content="<APP_NAME>">
<meta property="al:android:url" content="market://details?id=<PACKAGE_NAME>&referrer=utm_source%3D<REF_CODE>">
<meta property="al:android:app_name" content="<APP_NAME>">
<meta property="al:android:package" content="<PACKAGE_NAME>">
</head>
<body>
Redirect...
</body>
</html>
The problem is Facebook changes campaign parameters, so I receive something like this :
utm_source = apps.facebook.com
utm_content = {"app":0,"t":<SOME_NUMERIC_ID>}
utm_campaign = fb4a
Android-side: Send an invitation:
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl("<SERVER_SCRIPT_URL>.php?referral="+ref_code)
.setPreviewImageUrl("<IMAGE>.png")
.build();
if (AppInviteDialog.canShow()) {
appInviteDialog.show(getActivity(), content);
}
Android-side: Broadcast receiver:
@Override
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
String referrerString = extras.getString("referrer");
...
}
I found a similar question posted in 2014 here but no answer was provided.
So, my question is how can I pass my own parameter to Play Store via Facebook App Invites and how can I receive it with my BroadcastReceiver ?