The firebase AppInvitation isn't working reliably. If I try to send SMS, the invite activity stops immediately. Sending email invite works but the onActivityResult of the calling activity reports the return code as 0, as well as the "data" intent is NULL.
Unfortunately I think this is a known issue, that SMS invites crash on
Android O.
I'd recommend using your own UI on top of Dynamic Links to get SMS
invitation features.
On Fri, Nov 23, 2018, 8:04 AM trivalent notifications@github.com wrote:
>
- Android device: Nexus 5X
- Android OS version: 8.1.0
- Google Play Services version: 14.5.74 (040400-219897028)
- Firebase/Play Services SDK version:
Step 3: Describe the problem:
The firebase AppInvitation isn't working reliably. If I try to send SMS,
the invite activity stops immediately. Sending email invite works but the
onActivityResult of the calling activity reports the return code as 0, as
well as the "data" intent is NULL.
Steps to reproduce:
- Checkout/Download the Firebase quickstart-android samples
- Open in Android studio.
- Connect "invite" module to Firebase
- Launch the app.
Observed Results:
- The Invite activity quits unexpectedly on selecting a phone number
and sending invite- On sending email invites, the email is sent successfully, but the
onActivityResult reports resultCode as 0 (RESULT_CANCELLED) with data
intent NULL.Expected Results:
- SMS invite should work
- ON sending email /sms invites, the onActivityResult method should
receive RESULT_OK with relevant data—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/firebase/quickstart-android/issues/750, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AIEw6uT7lhrqgaeFmllYsZaIOsjPc7uqks5ux_JKgaJpZM4YwoJY
.
@samtstern Excuse me. I want to receive the invitation IDs at onActivityResult. Is there any way to get them?
Hi there,
When is the fix is expected to be released?
I get the same behavior in Android Pie as well.
@samtstern Is there any workaround for this? Will rolling back to a previous version help?
I resumed working on my project since I stopped 5 months ago, this feature just stopped working, any workaround?
the invitation is been sent and when the user clicks the invite I get the ID, but there is no way of storing that ID in the first place because the data variable is null on the activityresult
Same issue on Android 8.1.0. Please fix this
I even tried downloading the sample app, nothing works, I don't understand why so few people are complaining about this. Is there an alternative to this service?
Please fix the bug.😢
public class MainActivity extends AppCompatActivity {
private static final int REQUEST_INVITE = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void onInviteClick(final View view) {
Intent intent = new AppInviteInvitation
.IntentBuilder(getString(R.string.app_name))
.setMessage(getString(R.string.app_name))
.setDeepLink(Uri.parse("https://hoge.app.goo.gl/fuga"))
.setCustomImage(Uri.parse("https://hoge.com/img/image.png"))
.setCallToActionText(getString(R.string.download))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK && data != null) {
final String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
if (BuildConfig.DEBUG) {
android.util.Log.e("Arrays.toString(ids)", Arrays.toString(ids));
}
return;
}
Toast.makeText(getApplicationContext(), "failed", Toast.LENGTH_LONG).show();
/* On API Level 27 device(>=Android O),
Mails are sent expectedly.
But the following values are always shown unexpectedly.
requestCode = 1
resultCode = 0
data = null
*/
/*
It seems that firebase invites library uses SnackBar to show error message to end users
and it uses the overlay with window types. But Android O system cannot permits them.
@see https://developer.android.com/about/versions/oreo/android-8.0-changes
*/
}
}
}
Hi all. As of this week, Firebase Invites is deprecated. This means we won't be fixing any bugs or making any new features. Please see the documentation for information on how to migrate away from Invites and contact Firebase Support if this creates a problem for you:
https://firebase.google.com/docs/invites/
@samtstern Thanks for the update. Is there any way to get the number of invites when using the recommended approach (Create invitation links with Firebase Dynamic Links)? Our app has been rewarding users based on the number of invitation sent out and would like to retain that functionality post migration.
@Ethan1983 do you mean find out how many people they invited? It depends.
If your app builds the whole sharing UI, then obviously you will know how many people they share to. But if you just send an Intent out to a sharing app then there is no way to know.
@samtstern Yes, i meant by an Intent.
App specific sharing UI would work fine but users tend to avoid sharing contact info when dealing with a new app (especially for indie developers) due to privacy concerns (not to mention the overhead in building this sharing UI). I guess, it would also add a contacts permission dependency and that opens a possibility of potential abuse as well.
Firebase app invites worked great as the contact info was never shared with the app, the look and feel too was consistent across applications and was an easy buy for users. This deprecation is a bummer for indie apps :-(
@samtstern Just tried firebase-invites:16.1.0, with this update both email and SMS invites are working fine. Thanks team for this final release before phasing out.
Most helpful comment
Hi there,
When is the fix is expected to be released?