1

I am using app invite in my code. When user invite to other user, I am rewarding app user with some points. So here the problem is that, in response after invitation I am getting ids and those ids are always unique even I send invitation to same email or mobile number. So I can't detect that app user has invited to same user multiple time and user gets some reward points for same user again and again. Is there any mechanism to detect duplicate invitation ?

Any help would be appreciated, I got stuck..

@Override protected 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 " + id);
            }
        } else {
            // Sending failed or it was canceled, show failure message to the user
            // ...
        }
    } }
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Smeet
  • 4,036
  • 1
  • 36
  • 47
  • I am afraid it's not possible to achieve with the current version of firebase-invites. But it could be a nice feature to have in an upcoming version. Something like `AppInviteInvitation.getRecipientIds()` - each id identifying the invitation recipients across all invitations thus letting app discover duplicate invitations. Why not [request a new feature](https://firebase.google.com/support/contact/) ? – Benoit Sep 21 '18 at 15:17
  • @Benoit Let me request it, its very nice feature. I thought i dont know whether it is possible or not so posted here. – Smeet Sep 22 '18 at 03:44
  • Rewarding the user per invite is probably a bad idea, since you can enter *any* fake email / phone number as a Firebase Invite. – Jake Lee Nov 27 '18 at 13:51

0 Answers0