androidgoogle-app-invites

App Store link not shown in app-invites email


I'm trying to implement App Invites in our application, but I can't get the iOS clients to link to the App Store. They always show the Play store link.

According to the documentation, we need to call setOtherPlatformsTargetApplication if we have more than one iOS client id in our project in developers console. The thing is, if I try to add our iOS app client id, the email is never sent

.setOtherPlatformsTargetApplication(PROJECT_PLATFORM_IOS,
                    "104XXXXXXXXXX-i089XXXXXXXXXXXX.apps.googleusercontent.com")

If I omit this call, the email is sent but it points to Play store.

Anyway, inspecting google-services.json only shows one iOS client id

{
    "project_info": {
        ...
    },
    "client": [
        {
            "client_info": {
                "package_name": "com.mycompany"
            },
            "oauth_client": [
                ...
            ],
            "api_key": [

            ],
            "services": {
                "appinvite_service": {
                    "status": 2,
                    "other_platform_oauth_client": [
                        {
                            "client_id": "XXXXXX-YYYYY.apps.googleusercontent.com",
                            "client_type": 2,
                            "ios_info": {
                                "bundle_id": "com.mycompany.app",
                                "app_store_id": "123456789"
                            }
                        },
                        {
                            "client_id": "XXXXXX-JJJJJJJJ.apps.googleusercontent.com",
                            "client_type": 3
                        }
                    ]
                }
            }
        },
        [
            another client info for the debug package name
        ],
        "client_info": [

        ],
        "ARTIFACT_VERSION": "1"
    }

I don't know what else I can try, any idea is welcome

I'm using AS 2.0 preview 9, and 2.0.0-alpha9 versions for android and google-services' gradle plugin. Also, as stated in the documentation, I've placed the apply plugin at the bottom of app/build.gradle


Solution

  • The problem was that I had 2 credentials that shared the same Bundle ID.

    Furthermore, the most recently added (and the only one listed in google-services.json) was not being used. Once I deleted it, the real credential was added to the json file and the call to setOtherPlatformsTargetApplication worked just fine.