0

These days I'm launching a new Android app, but it's iOS version will be available in the App Store in few months. Within the app there is an option to invite friends to download the app via Firebase Invites.

So I created a Dynamic Link using the Firebase console that should work as follows:

if ( IOS ) {
    // Go to app website
} else if ( ANDROID ) {
    if ( APP_INSTALLED ) {
        // Open app
    } else {
        // Open Google Play
    }
} else if ( DESKTOP ) {
    // Go to app website
}

The link itself looks like this (private info removed):

     https://[custom_domain].app.goo.gl/?
     link=https://app_website.com&
     apn=com.my.app&st=meta+data_header&
     sd=meta+data+description&
     si=https://app_website.com/meta_data_image.png&
     utm_source=INVITE&
     efr=1

The Firebase Invites is implemented as follows:

Uri deepLink = Uri.parse( getString( R.string.invitation_deep_link ) );
String invitationMessage = getString( R.string.invitation_message );
String emailTitle = String.format( getString( R.string.invitation_email_title ), getUserName() );

Intent intent = new AppInviteInvitation.IntentBuilder( getString( R.string.invitation_title ) )
    .setMessage ( invitationMessage )
    .setDeepLink( deepLink )
    .setEmailSubject( emailTitle )
    .setEmailHtmlContent( mRawEmailHtml )
    .setOtherPlatformsTargetApplication(
                    AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS,
                            getString( R.string.ios_app_client_id ) )
    .build();

startActivityForResult( intent, InviteActivity.REQUEST_INVITE );

On Android it works fine, but on iOS, some strange stuff is going on.. here are the use cases:

SMS

  1. Clicking the received link on an Android device that have the app installed already -> The app opens [great!]
  2. Clicking the received link on an Android device that DO NOT have the app installed already -> Google Play opens [great!]
  3. Clicking the received link on an iPhone that DO NOT have the app installed already -> the browser opens with a JavaScript popup on top and asks:

Open this page in "App Store"?

Clicking Ok will open the App Store on "Item not available" page, and clicking Cancel will leave the user in a blank browser page. [Not so great at all!]

Email

  1. Clicking the received link on an Android device that have the app installed already -> The app opens [great!]
  2. Clicking the received link on an Android device that DO NOT have the app installed already -> Google Play opens [great!]
  3. Clicking the received link on an iPhone that DO NOT have the app installed already -> the browser opens with an iOS native popup on top and says:

This page will open in another application.

Clicking Ok will open the iTunes Store on "Item not found" page, and clicking Cancel will leave the user in a blank browser page. [Not so great at all!]

For me, it looks like Google have a bug - I hope I'm wrong and the one with the bug is me.. Can anyone shed some light on the subject?

Barakuda
  • 790
  • 8
  • 16

1 Answers1

0

Couple comments:

1) Popup "Open this page in "App Store"?" is unavoidable on iOS. This is iOS feature and this dialog can't be removed. Functionality of this dialog can't be altered as well. I am not sure about "This page will open in another application." This may be email specific dialog. As a baseline, try tapping on your link in Notes iOS App.

2) If you did not specified iOS Bundle ID and AppStore ID the Firebase Dynamic Links have no information about your iOS App. In this case link should navigate to deep link (https://app_website.com) when opened on iOS. I see in your code you assigning ios_app_client_id. Why you doing this if your iOS App is not available yet?

3) To validate long or short link please append &d=1 to the link. Such link will navigate to debug page where details of link navigation flow will be exposed.

Feel free to open Firebase bug if issues persist.

Oleksiy Ivanov
  • 2,454
  • 15
  • 21
  • Thanks a lot Oleksiy. After running some tests, I come to understand that the cause for the strange behavior (dialogs and wrong redirecting) was Firebase Invites as it alters my Dynamic link and causing it to function incorrectly.. So sadly, I ended up removing Firebase Invites from my project and implementing my own custom invite UI and the logic behind it.. – Barakuda Aug 23 '17 at 23:33