使用Branch创建用户邀请代码的正确方法是什么? [英] What is the proper way to create user invite codes using Branch?

查看:101
本文介绍了使用Branch创建用户邀请代码的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在梳理Branch.io Android文档,但没有提出如何创建用户邀请代码的方法.我已经使基本的Branch推荐系统正常运行,但是我想为每个用户分配一个自定义邀请代码,类似于您在Uber和Airbnb上看到的代码.

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.

我当前的实现如下:

    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

但是我想分享以下内容: ADAM98 (请参见上面的屏幕截图),并让用户在结帐时输入它.

But I'd like to share something like: ADAM98 (see screenshot above), and have the user enter it at checkout etc.

现在为每个用户手动创建邀请代码并不需要很多工作,我可以采用用户名的前四个字符并在其中添加一些随机字符.但是那我该怎么办呢?我以为我只需要将此代码传递给 mSmsLinkProperties 上的 .setAlias(mUserInviteCode).

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?

推荐答案

此处来自Branch.io的亚历克斯.

Alex from Branch.io here.

我们实际上曾经完全按照您所描述的那样提供引荐 code 功能,但不久前不推荐使用此功能,而推荐了引荐 link 系统.其原因实际上非常有趣:我们的合作伙伴应用发现不必要的代码和大量的额外工作.Branch处理引用的方式从根本上不同,并且更加用户友好,因此实际上您根本不需要让用户输入代码.

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.

  1. 邀请用户获取代码
  2. 邀请用户给朋友(被邀请用户)提供一个密码,并说去下载此应用并输入我的密码!"
  3. 受邀用户希望下载该应用程序,希望找到如何输入代码,希望正确输入代码
  4. 邀请用户获得奖励
  1. Inviting User gets a code
  2. Inviting User gives a code to a friend (Invited User) and says 'go download this app and enter my code!'
  3. Invited User hopefully downloads the app, hopefully finds out how to enter a code, hopefully enters the code correctly
  4. Inviting User gets a reward

如您所见,很多地方该过程可能会出错.

As you can see, plenty of places where that process can go wrong.

  1. 邀请用户获得链接
  2. 邀请用户将链接发送给朋友(邀请用户)
  3. 受邀用户单击链接,直接发送到Play商店,下载应用,然后自动触发引荐兑换逻辑,无需任何手动工作
  4. 邀请用户获得奖励
  1. Inviting User gets a link
  2. Inviting User sends the link to a friend (Invited User)
  3. 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
  4. Inviting User gets a reward

之所以可行,是因为Branch会跟踪最初创建链接的用户,并且可以在新用户打开链接后第一次成功下载/购买/进行其他操作时进行报告.这是一个更简单,更无缝的过程,Branch引用基础结构是如此可靠,以至于可以正常工作".

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'.

这是用于设置此内容的文档页面: https://dev.branch.io/features/referral-programs/

Here is the documentation page for setting this up: https://dev.branch.io/features/referral-programs/

这篇关于使用Branch创建用户邀请代码的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆