获得应用邀请后,被邀请者点击链接.根据已经安装的应用程序,他将被引导到app store,最后来到处理AppInite链接的Actiity.
我的深层链接看起来像这样:http: //example.com/app-invite/
其中user_id是注册用户的id(在我的后端服务器中).我能够获得用户的正确ID.
这是处理深层链接的代码.
private void processReferralIntent(Intent intent) {
String invitationId = AppInviteReferral.getInvitationId(intent);
String deepLink = AppInviteReferral.getDeepLink(intent);
String userId = deepLink.substring(deepLink.lastIndexOf("/") + 1);
Utility.displayToast("userid " + userId);
// Handle the deep link. For example, open the linked
// content, or apply promotional credit to the user's
// account.
Log.d(TAG, "Found Referral: " + invitationId + ":" + deepLink);
((TextView) findViewById(R.id.deep_link_text))
.setText(getString(R.string.deep_link_fmt, deepLink));
((TextView) findViewById(R.id.invitation_id_text))
.setText(getString(R.string.invitation_id_fmt, invitationId));
}
Run Code Online (Sandbox Code Playgroud)
现在,如果这是被邀请者第一次安装应用程序,点击应用邀请链接,我想给被邀请者和邀请者一些促销信用.
我怎么知道这是第一次?甚至应用程序安装alredy processReferralIntent()将被调用.
开发一个具有Firebase作为后端的应用程序.目前,在实施Firebase App Invite时卡住了.只是想发送邀请(当前没有尝试通过安装的新用户实现动态链接的点击),但onActivityResult返回错误的result_code
遵循的步骤
btnInvite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new AppInviteInvitation.IntentBuilder(INVITATION_TITLE)
.setMessage(INVITATION_MESSAGE)
.setDeepLink(Uri.parse("https://ewyc6.app.goo.gl/eNh4"))
.setCallToActionText(INVITATION_CALL_TO_ACTION)
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
});
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode + "result_ok ="+RESULT_OK);
if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK) {
// You successfully sent the invite,
// we …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Firebase在我的Android应用中实施App Invite系统.代码与他们的指南中给出的完全相同.
private void onInviteClicked() {
Intent intent = new AppInviteInvitation.IntentBuilder("Title here")
.setMessage("message here")
.setDeepLink(Uri.parse("deep_link_here")
.setCallToActionText("Install!"))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);
if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK) {
// Get the invitation IDs of all sent messages
String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
for (String id : ids) {
Log.d(TAG, "onActivityResult: sent invitation " …Run Code Online (Sandbox Code Playgroud) 我有Firebase邀请使用电子邮件和短信很好.然而,当谈到通过Facebook或Twitter分享时,我很无能为力.通过Firebase与facebook邀请分享数据的选项有哪些?我无法在任何地方找到任何信息 - 除了Facebook提供自己的邀请API.我试图尽可能使用Firebase,所以我只想弄清楚如何自定义我在网上各种位置引用的"共享表"(没有与这些引用相关的太多信息).我不知道共享表是否只是我需要处理自己的方式的行动列表,只有谷歌处理的电子邮件和短信选项,我使用各种apis处理其余的选项.
在我当前的实现中,我使用邀请公开的深层链接并存储我希望特定用户有权访问的某些数据的ID.然后将该数据存储在firebase数据库中.但是分享给Facebook用户的正确方法是什么?是不是只使用facebook的api并在我自己的"自定义共享表"中以某种方式公开它?我在哪里可以找到共享表上的文档?
如果可以的话,谢谢你澄清这些!
干杯,迈克
我使用过Firebase Dynamics链接,它可以打开我的应用,去玩商店或转到网址.但是当我通过链接传递一些参数时,我只能得到第一个参数.这是我的动态链接:
https://xx.app.goo.gl/?link=http://xx.com/?usn=abc&pass=def&apn=com.xx&afl=http://google.com
Run Code Online (Sandbox Code Playgroud)
我使用此代码获取链接:
// Build GoogleApiClient with AppInvite API for receiving deep links
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this)
.addApi(AppInvite.API)
.build();
// Check if this app was launched from a deep link. Setting autoLaunchDeepLink to true
// would automatically launch the deep link if one is found.
boolean autoLaunchDeepLink = false;
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
.setResultCallback(
result -> {
if (result.getStatus().isSuccess()) {
// Extract deep link from Intent
Intent intent = result.getInvitationIntent();
String deepLink = AppInviteReferral.getDeepLink(intent);
Logger.e(deepLink);
}
}
); …Run Code Online (Sandbox Code Playgroud) 我的应用程序中有firebase邀请.我通过邮件和消息为ios和android平台发送邀请.当我通过消息发送它时,它在两个设备中都能正常工作,它会在Android的Play商店中打开app,在iphone的app store中打开app.但是当我通过邮件发送邀请时,点击安装链接时,会出现404错误.
这是我在android或iphone中打开它时获得的链接.
这是我用来邀请的代码.
// Invite friends
id<FIRInviteBuilder> inviteDialog = [FIRInvites inviteDialog];
[inviteDialog setInviteDelegate:self];
FIRInvitesTargetApplication *targetApplication = [[FIRInvitesTargetApplication alloc] init];
targetApplication.androidClientID = @"android_client_id";
[inviteDialog setOtherPlatformsTargetApplication:targetApplication];
NSString *message = [NSString stringWithFormat:SHARE_MESSAGE];
[inviteDialog setMessage:message];
[inviteDialog setTitle:@"Invite Friends"];
[inviteDialog open];
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题.任何帮助,将不胜感激.谢谢
我想试试来自firebase的app-invites - 遗憾的是onActivityResult使用onActivityResult报告回来3.仅使用此文档中的代码:https://firebase.google.com/docs/invites/android
我明白了:
requestCode=101, resultCode=3
Run Code Online (Sandbox Code Playgroud)
在我选择一个联系人并看到我通过的标题和文本之前 - 遗憾的是在日志中没有提示.
输入SHA-1并为该应用程序工作(已经成功使用了firebase分析)
我无法使用Android Firebase Invite SDK创建ShortDynamicLink.我可以创建很长的DynamicLink,但它始终无法创建ShortDynamic链接,始终给出错误请求的错误消息.这是代码:
private void sendInvite(String uid, final String displayName){
String link = "https://appdomain.com/?invitedby=" + uid;
com.google.android.gms.tasks.Task<ShortDynamicLink> shortLinkTask = FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse(link))
.setDynamicLinkDomain(Constants.DYNAMIC_LINK_DOMAIN)
.buildShortDynamicLink()
.addOnCompleteListener(mActivity, new OnCompleteListener<ShortDynamicLink>() {
@Override
public void onComplete(@NonNull com.google.android.gms.tasks.Task<ShortDynamicLink> task) {
if (task.isSuccessful()){
Uri shortLink = task.getResult().getShortLink();
// String referrerName = SettingsHelper.getHelper(mActivity).getDisplayName();
String subject = String.format("%s wants you to try Awesome App!", displayName);
String invitationLink = shortLink.toString();
String msg = "Enjoy and share your moments with Awesome App! Use my referrer link: "
+ invitationLink;
String …Run Code Online (Sandbox Code Playgroud) 根据firebase文档,他们提到Google登录需要发送邀请.我假设他们正在使用Google登录与本地联系人进行映射,并显示用于发送邀请的自定义屏幕.我可以创建自定义邀请链接并使用iOS上的messageController发送它吗?
Firebase Invites似乎附带了一个用于在iOS和Android上创建引荐链接的UI.由于我们正在制作游戏,我们希望使用自己的UI(至少可选择跳过显示标准系统UI).
是否有可能以编程方式将引用链接复制到剪贴板而不显示Invite UI?
android ios firebase firebase-invites firebase-dynamic-links
我正在尝试更新到Firebase产品的15.x API版本.以某种方式firebase-invites:15.0.2无法找到:
Could not find com.google.firebase:firebase-invites:15.0.2.
Searched in the following locations:
file:/D:/SDK/extras/m2repository/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.pom
file:/D:/SDK/extras/m2repository/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.jar
file:/D:/SDK/extras/google/m2repository/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.pom
file:/D:/SDK/extras/google/m2repository/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.jar
file:/D:/SDK/extras/android/m2repository/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.pom
file:/D:/SDK/extras/android/m2repository/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.jar
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.pom
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.jar
https://jcenter.bintray.com/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.pom
https://jcenter.bintray.com/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.jar
https://jitpack.io/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.pom
https://jitpack.io/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.jar
https://maven.fabric.io/public/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.pom
https://maven.fabric.io/public/com/google/firebase/firebase-invites/15.0.2/firebase-invites-15.0.2.jar
Required by:
project :app
Run Code Online (Sandbox Code Playgroud)
我在root build.gradle中有Google maven存储库: