Facebook Deep Link Tester Works, Ad Doesn't - android

Pretty straightforward situation: I'm doing deferred deep links for Facebook ads and have successfully tested them via the Deep Link Tester found here (to be clear I do also select "Send Deferred".) However, putting the app into production, even though I am certain that the app has received new launches via ads, the deferred deep link code returns null. Testing it via an Ad Preview is broken as well.
I'm not getting any errors logged from the Facebook SDK and I have confirmed that both the application id and the client token exist when I make the fetchDeferredAppLinkData call.
I've exhausted StackOverflow/Facebook/Google for possible solutions or reasons why there would be a difference between the Deep Link Tester and the actual ad, but have 0 clue. Any direction or thoughts would be really helpful, thanks so much!
For reference, here's the code I'm using to handle the deferred deep link:
AppLinkData.fetchDeferredAppLinkData(cordova.getActivity().getApplicationContext(),
new AppLinkData.CompletionHandler() {
#Override
public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
if(appLinkData != null) {
//Handling link
}
}
}
);
EDIT: It looks like we're now getting the fetchDeferredAppLinkData to return values in production, this was after saving the client token in onCreate. However, Ad Previews still don't work in testing; is this by design? Are Ad Previews not intended to be fully-functional and thus shouldn't be used for this purpose?

Related

How to test Deferred Deep Linking with AppsFlyer?

I'm integrating AppsFlyer with Android Native Application. And I want to use Deferred Deep Linking, when user click landing page ads and download the app and upon first app open the user lands directly on the activity I want.
Link docs: https://support.appsflyer.com/hc/en-us/articles/207032096-Deferred-Deep-Linking-Getting-the-Conversion-Data
But I have not found a way to check that my code is running correctly.
Please help me with this problem
What was working for me is:
Add physical device as a test device in AppsFlyer (here's how to do it)
Enable Debug Mode in AppDelegate.swift in didFinishLaunchingWithOptions
AppsFlyerTracker.shared().isDebug = true
Add AppsFlyer methods in your AppDelegate.swift (as per article)
Remove app (or test build) from physical device
Open Deep Link from physical device, you will be redirected to App Store. Don't install app from the App Store!!! (just close it)
Install app via XCode
After it, on a first install it will call onConversionDataReceived method and the rest staff.
You're going to have to implement the onInstallConversionDataLoaded listener:
public interface AppsFlyerConversionListener {
void onInstallConversionDataLoaded(Map<String,String> conversionData);
void onInstallConversionFailure(String errorMessage);
}
This will return a map of all the parameters on the link that you clicked.
The parameter you need to pay attention to is the af_dp parameter.
This parameter should contain the URI scheme of the activity you want to route your users to. Make sure that you have set up this URI scheme properly in the manifest.
To create a tracking link you can use Link Management. It doesn't matter if it's a single platform link or a OneLink, as long as you have the af_dp parameter on the link, that parameter (along with all other parameters on the link) will be part of the response.
If you're still facing issues, feel free to reach out to support#appsflyer.com.

What is the proper way to create user invite codes using Branch?

I've been combing through the Branch.io Android docs and haven't come up with how to create user invite codes. I've gotten the basic Branch referral system working ok, but I'd like to assign each user a custom invite code similar to what you see with Uber and Airbnb.
My current implementation looks like this:
mSmsBranchUniversalObject = new BranchUniversalObject()
.setCanonicalIdentifier("invite/sms")
.setTitle(getString(R.string.simple_share_title))
.setContentDescription(getString(R.string.default_share_desc))
.addContentMetadata("userId", mUserId);
mSmsLinkProperties = new LinkProperties()
.setChannel("sms")
.setFeature("sharing");
mSmsBranchUniversalObject.generateShortUrl(getActivity(), mSmsLinkProperties, new Branch.BranchLinkCreateListener() {
#Override
public void onLinkCreate(String url, BranchError error) {
if (error == null) {
mSmsShareLink = url;
}
}
});
#OnClick(R.id.iv_sms)
public void smsShare() {
Branch.getInstance(getActivity()).userCompletedAction(BranchEvent.SHARE_STARTED);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:"));
intent.putExtra("sms_body", getString(R.string.share_sms, mSmsShareLink));
startActivity(intent);
}
The following implementation gets me a link that looks something like this:
https://mydomain.app.link/A1BCdEf2gH
But I'd like to share something like: ADAM98 (see screenshot above), and have the user enter it at checkout etc.
Now creating an invite code manually for each user isn't much work, I could take the 1st four characters of the user's username and append some random characters to it. But then what do I do with it? I assumed that I would simply need to pass this code to .setAlias(mUserInviteCode) on mSmsLinkProperties.
Am I on the right track here? What is the proper flow to implement this? How do you handle this invite code once received on the install?
Alex from Branch.io here.
We actually used to offer a referral code feature exactly as you've described, but deprecated it a while back in favor of a referral link system. The reason why is actually quite interesting: our partner apps found codes unnecessary and a lot of extra work. The way Branch handles referrals is fundamentally different and far more user-friendly, so you actually don't need to make the user enter a code at all.
Traditional app referral process
Inviting User gets a code
Inviting User gives a code to a friend (Invited User) and says 'go download this app and enter my code!'
Invited User hopefully downloads the app, hopefully finds out how to enter a code, hopefully enters the code correctly
Inviting User gets a reward
As you can see, plenty of places where that process can go wrong.
Branch referral process
Inviting User gets a link
Inviting User sends the link to a friend (Invited User)
Invited User clicks the link, is sent directly to the Play Store, downloads the app, and automatically triggers the referral redemption logic without any manual work
Inviting User gets a reward
This works because Branch tracks the user who originally created the link, and can report back on that when the new user successfully downloads/purchases/whatever else the first time after opening the link. It is a much simpler and more seamless process, and the Branch referral infrastructure is so reliable that it 'just works'.
Here is the documentation page for setting this up: https://dev.branch.io/features/referral-programs/

how to get facebook game request url?

we are using facebook unity sdk game requests on android.
when someone clicks a game request in their facebook notifications
they switch to the game or the app store page (if it's not installed)
when the game runs, we call FB.GetAppLink(DeepLinkCallback)
however, we receive empty url.
anyone knows how to achieve this ?
Thanks.
Full code:
void AfterInit(){
FB.GetAppLink(DeepLinkCallback);
}
void DeepLinkCallback(IAppLinkResult result) {
Debug.Log("app url = "+result.Url);
}
Update:
Sorry For posting the same code. I have a question for you.
Is your app life in the store and linked to Facebook developer profile correctly? If is in test mode it can fail.
However I believe that the ID you need to send in-app invites is the app ID from Facebook developer profile.
(check the image)
Facebook developer profile
the example code for the in-app invites is this
FB.Mobile.AppInvite(
new Uri("https: // fb. me/810530068992919"), //the ID
new Uri("http://i.imgur.com/zkYlB.jpg"), // optional image
AppInviteCallback //callback function
);
Hope that this can solve your issues.
Thanks.

"Page not found" when a user clicks on a Facebook invite from my application

I'm not sure if this is a programming related problem or not, but as I have no experience with the Facebook SDK I'm just assuming that I did something wrong somewhere, even though I've followed the documentation to the T.
I am using the Unity SDK for anybody that is curious, and I am using the FB.AppRequest to send the invite to the application, the code in my application looks exactly like that in the documentation.
public void InviteFriends() {
FB.AppRequest(
message: "Come play this great game!",
callback: LogCallback
);
}
void LogCallback(FBResult result) {
Debug.Log("Callback was called: " + result.Text);
}
This brings up the box as expected and allows me to invite a friend, and the friend does get the invite, however once they click on the invite they are redirected to a page that looks like this:
Which is causing quite a bit of problems for me; I've checked everything in the application panel and it seems like everything checks out. My google play identifier is correct as-well as my Class Name. My key hashes are all correct. I don't know what else I can do. If you'd like to look up my bundle identifier on the play store it's buzz.qualify and I'm sure that you'll find it with ease.
I should also add that I have an application page which can be found here: https://www.facebook.com/pages/Qualify/1647231425506903?fref=ts
This page is linked to the facebook application in the developer console as-well.
What can I do to resolve this issue? Is it in the code? Please help, this has been a 4 day long set-back and we're losing progress rapidly because of it.
It's been a few days now, we're now paying someone for a fix through paypal.
Do you have Canvas App setup on Facebook for your Android Game?
If not, read
Requirements for Invitable Friends.
It states that your game request will...
direct recipients to one of the following places:
Your app on Facebook Canvas.
Your native app on iOS or Android, if installed.
The Apple App Store or Google Play, if not installed.

Requesting more than one oauth2 scope through AccountManager in Android

I'm in a situation where I need to request access tokens for two scopes (from my android application), https://www.googleapis.com/auth/userinfo.email and https://www.googleapis.com/auth/userinfo.userinfo
I would like to get both permissions on a single call to getAuthToken, but can't figure out the string to pass in the authTokenType parameter. I tried several reasonable combinations with no positive results :(
Has anyone solved this issue? Is it possible?
I was having the same issue. Shah is almost right, but his scope string is wrong. It should be
"oauth2:<scope_url> <scope_url>"
not
"oauth2:<scope_url> oauth2:<scope_url>"
If you need multiple OAuth 2.0 scopes, use a space-separated list.
oauth2:https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.userinfo
You asked for sample code, so have a look at the Google Docs Upload Sample application, and in this application have look at the authentication flow done in this sample Android screen (ignore that it's about Google Docs, it still authorizes first). You can get the whole application and run it in an emulator with Google APIs present or run it on your phone. The authorization workflow starts with the buttonAuthorize click, Authorize() and you are specifically interested in this method:
private void gotAccount(Account account)
{
Bundle options = new Bundle();
accountManager.getAuthToken(
account, // Account retrieved using getAccountsByType()
"oauth2:https://www.googleapis.com/auth/userinfo.email oauth2:https://www.googleapis.com/auth/userinfo.userinfo", // Auth scope
//"writely", // Auth scope, doesn't work :(
options, // Authenticator-specific options
this, // Your activity
new OnTokenAcquired(), // Callback called when a token is successfully acquired
null); // Callback called if an error occurs
}
The user gets this access request screen:
Note that this is using the 'local' OAuth2 mechanism, not opening a web browser, but using the authentication provided when you first activated the Android phone.
Also note that the user sees the full URL of the scope instead of a friendly name, I haven't found a way around this and if you do find out it would be great if you could share the answer.

Categories

Resources