27

I've trying to send invitations with Firebase Invites. When select an email from a contact, Firebase says that has sent the invitation, but the email is never received.

On the console the SHA1 certicates are configurated.

The errorcode returned is always RESULT_OK and the number of invitations returned from AppInviteInvitation.getInvitationIds is correct.

The SDK is updated on gradle with the latest version, 10.0.1, like explained on the documentation.

The code that creates the invitation is:

Intent intent = new AppInviteInvitation.IntentBuilder(title)
                .setMessage(msg)
                .setCallToActionText(callToActionText)
                .setOtherPlatformsTargetApplication(AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS, IOS_CLIENT_ID)
                .build();

Any ideas?

luizfzs
  • 1,328
  • 2
  • 18
  • 34
mabg
  • 1,894
  • 21
  • 28
  • can you provide some part of code where you receive it? like in [this guide](https://firebase.google.com/docs/invites/android#receive-invitations) – koceeng Feb 17 '17 at 08:58
  • Sorry, I've discarded Invites and I'm not using any more. But I've never implemented this kind of code because the only interest for my app is say to other people than my app exists, no pass data. – mabg Feb 17 '17 at 13:04
  • Are you sure that the build you are using uses the exact same signed key/packagename as the one that's configured on the console? (For example: in certain cases a local debug or local release build may not work where a google-play beta apk will work) – ZeroStatic Jun 01 '17 at 13:14

2 Answers2

2

I had the same problem and I managed to fix it, although I am not pretty sure what step actually helped.

It's worth specifying that in my case the email was perfectly sent when I removed the method call:

.setOtherPlatformsTargetApplication(...)

The following steps were applied:

  1. All fields were filled on Firebase console for Android and iOS project settings (including App ID Prefix and App Store ID).
  2. SHA-256 hashes (from debug and release keystore) were added for Firebase Android project settings:

    keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v
    
  3. Updated google-services.json was downloaded from Firebase Android project settings and added to the application root (with GoogleServicesJson Build Action for Xamarin). So the file among others contains the following:

    ...
    "appinvite_service": {
      "status": 2,
      "other_platform_oauth_client": [
        {
          "client_id": "1234567890-specified_ios_client_id.apps.googleusercontent.com",
          "client_type": 2,
          "ios_info": {
            "bundle_id": "ios.app.bundle.id",
            "app_store_id": "9876543210"
          }
        },
        ...
      ]
    }
    ...
    

The specified client_id is the same in .setOtherPlatformsTargetApplication(...) method call and in google-services.json

Also Firebase Invites had been previously adjusted for the iOS project, but I don't see if it could help for the Android anyhow.

Olexander Ivanitskyi
  • 2,202
  • 17
  • 32
  • Commenting out ".setOtherPlatformsTargetApplication(...)" made it to work. Then found out the problem was - using debug iOS client ID for both prod and debug versions. – Surekha Dec 07 '17 at 22:26
  • I can't understand, after following these steps invites are sent again without removing .setOtherPlatformsTargetApplication(...)? – FilippoG Mar 10 '18 at 07:35
  • In my case yes, it works with .setOtherPlatformsTargetApplication(...) – Olexander Ivanitskyi Mar 10 '18 at 07:51
  • @Surekha where do you see debug and prod client id? I seem to have only one entry like Olexander shown in his json. – FilippoG Mar 10 '18 at 10:57
0

Removing .setOtherPlatformsTargetApplication(...) allowed Android to send invitations again.

When invitations are received on iOS though, they work correctly opening link with:

  • Gmail or Mail with app installed (opens app correctly)

They do not work properly:

  • Link reading email in Safari with app not installed, goes to google play store
    • Link in Gmail or Mail app, with app not installed, goes to google play store
FilippoG
  • 546
  • 3
  • 16