【问题标题】:Android - Google App Invites - Getting referral informationAndroid - Google App Invites - 获取推荐信息
【发布时间】:2015-09-11 01:16:38
【问题描述】:

我正在设计一个使用 Google 应用邀请系统的应用。我想做的是通过某种方式获取发送邀请的人的电子邮件。

即用户 1 发送邀请 > 用户 2 安装应用程序 > 活动说“你是由 User1@gmail.com 邀请的”

到目前为止,我已经实现了 Google Tutorial,它运行良好,允许人们邀请其他人安装应用程序。

我认为必须对此进行更改,但我不确定

@Override
public void onReceive(Context context, Intent intent) {
    // Create deep link intent with correct action and add play store referral information
    Intent deepLinkIntent = AppInviteReferral.addPlayStoreReferrerToIntent(intent,
            new Intent(context.getString(R.string.action_deep_link)));

    // Let any listeners know about the change
    LocalBroadcastManager.getInstance(context).sendBroadcast(deepLinkIntent);
}

【问题讨论】:

    标签: android google-app-invites


    【解决方案1】:

    我们可以这样获取 GMail id:

    try {
            AccountManager accountManager = AccountManager.get(context);
            Account account = getAccount(accountManager);
            if (account == null) {
                return "";
            } else {
                return account.name;
            }
        } catch (Exception ex) {
            return "";
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-27
      • 1970-01-01
      • 1970-01-01
      • 2016-02-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多