Can not add Apple client ID to Firebase invites intent on Android

Deadly 提交于 2019-12-11 08:15:28

问题


When creating Firebase invite intent I try to add link to iOS app as described in documentation:

    intent = new AppInviteInvitation.IntentBuilder(context.getString(R.string.invitation_title))
            .setMessage(context.getString(R.string.invitation_message))
                .setOtherPlatformsTargetApplication(
                        AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS,
                        "1059710961")
            .build();

"1059710961" and "mobi.appintheair.wifi" both cause the same error:

AppInviteAgent: Create invitations failed due to error code: 3
AppInviteAgent: Target client ID must include non-empty and valid client ID: 1059710961. (APPINVITE_CLIENT_ID_ERROR)

What is the correct format for this parameter?


回答1:


To get this client ID you have to do the following:

  1. Register you iOS app in the Firebase Console
  2. Download GoogleServices-Info.plist for iOS app as we download google-services.json for Android
  3. Look in it and found value for the key CLIENT_ID (will be something like this 123456789012-abababababababababababababababab.apps.googleusercontent.com)
  4. Add it to builder:

    intent = new AppInviteInvitation.IntentBuilder(context.getString(R.string.invitation_title))
        ............
        .setOtherPlatformsTargetApplication(
            AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS,
            "123456789012-abababababababababababababababab.apps.googleusercontent.com")
        .build();
    



回答2:


the client_id is the one in the plist you download from the firebase console for your iOS app



来源:https://stackoverflow.com/questions/37836448/can-not-add-apple-client-id-to-firebase-invites-intent-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!