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
- Clicking the received link on an Android device that have the app installed already -> The app opens [great!]
- Clicking the received link on an Android device that DO NOT have the app installed already -> Google Play opens [great!]
- 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!]
- Clicking the received link on an Android device that have the app installed already -> The app opens [great!]
- Clicking the received link on an Android device that DO NOT have the app installed already -> Google Play opens [great!]
- 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?