I have searched SO and the web for a similar issue, and while others appear to have encountered this problem, their solutions are not working for me.
DFL parameter in Firebase Dynamic Links Builder
Starting with Android, I'm attempting to implement the Dynamic Links for my app. The app requires additional parameters on the dynamic link, so I'm manually constructing the link based on the information here: https://firebase.google.com/docs/dynamic-links/create-manually.
I have created my link in the following manner (code abbreviated for purposes of this post)
Uri.Builder builder = new Uri.Builder()
.scheme("https")
.authority(AppPrivate.Invitation.APP_CODE + ".app.goo.gl")
.path("/")
.appendQueryParameter("link", link)
.appendQueryParameter("apn", AppPrivate.PACKAGE)
.appendQueryParameter("dfl", desktopLink);
For my use case the link and desktopLink parameters are the same - they are actual working URLs on my website. Regardless of what device the user hits with the dynamic link, it should perform the desired action. Again, for purposes of simply getting this working, I've linked to our primary website (https://www.mytravelerapp.com).
When I send the invitation from my Android device, I generate an intent based on the code sample here: https://github.com/firebase/quickstart-android/blob/master/invites/app/src/main/java/com/google/firebase/quickstart/invites/MainActivity.java
return new AppInviteInvitation.IntentBuilder(context.getString(R.string.content_trip_invitation_title))
.setMessage(message)
.setDeepLink(uri)
.setCustomImage(Uri.parse(AppPrivate.Invitation.TRIP_INVITE_DEEP_LINK_IMAGE))
.setCallToActionText(context.getString(R.string.content_trip_invitation_cta))
.build();
However, when I receive the invitation via email on my desktop, it always goes to the Play Store listing, no matter what I've added to the initial deep link (DFL, AFL). Here's a sample of the link from the "call to action" button from the email:
https://a3d4u.app.goo.gl/i/225742434763-3bd2c2fa-45f0-4ed8-aca3-37760d27d971
I've not yet implemented the receivers in the android app to listen for incoming links, so I cannot confirm whether or not the deep link behaves appropriately on that platform.
Any recommendations or suggestions on what I'm missing with the desktop link are greatly appreciated.
Thanks!
You're actually wrapping a dynamic link in another dynamic link. Invites itself generates a dynamic link, which doesn't have your DFL parameter, so it is redirecting to the store.
You could try shortening the dynamic link you generate, and sharing via the regular share dialog rather than using Invites.
Related
I've followed the instructions from the official react-native-firebase documentation and everything, as per the instructions, works fine.
It is my understanding that I should be able to create a link like the following in the Firebase Dynamic Links console: https://myapp.page.link/offer?offerid=123456 and be able to receive the offerid parameter in my app. However, when I click that link (in the iOS simulator, Android emulator, and on a real device) the app opens, but I just get a link with the following data:
Received initial link {"minimumAppVersion": null, "url": "https://mysite.co/offers"}
There are no query string parameters attached. Am I missing something in the Firebase Dynamic Link configuration? Or in my implementation of react-native-firebase that was not covered in the documentation linked above? Or is this actually just not possible?
I think you are confusing deep links with dynamic links. Dynamic links handle your deep links to content depending upon the platform.
Example you have a deep link: https://example.com/offer?offerid=123456 .
You wish to open it in your app depending upon the platform.
Suppose you created a domain for dynamic link from console: https://myapp.page.link
Now you can create a dynamic link which opens the deep linked content on your app. The dynamic link can take in only specific parameters as mentioned here. However you can pass your parameters to your deep link,
https://myapp.page.link/?link=https%3A%2F%2Fexample.com%2Foffer%3Fofferid%3D123456&apn=com.example.app&ibi=com.example.app
The above dynamic link opens the deep link in your android app with package name com.example.app and ios app with bundle ID com.example.app.
I need to programmatically build a dynamic link using the Dynamic Link Builder API on Android (https://firebase.google.com/docs/dynamic-links/android/create). This is the only option applicable for my case since I need to track click data and shorten links.
This link can be opened on the desktop, but the problem is that the link will be eligible only for mobile apps - the website is unable to recognize this link (this behavior is intentional). I would like the desktop user is directed to the website's main page.
Here is the quote from Firebase doc:
When users open a Dynamic Link on a desktop web browser, they will load this URL (unless param dfl is specified). If you don't have a web equivalent to the linked content, the URL doesn't need to point to a valid web resource. In this situation, you should set up a redirect from this URL to, for example, your home page.
I see I need dfl parameter. (dfl is The link to open on desktop, overriding param link.) How can I specify dfl parameter using Dynamic Links Builder on Android?
I know that I can specify dfl by building dynamic link manually - https://firebase.google.com/docs/dynamic-links/create-manually
But this approach is not useful for me since it has such constraints:
If you don't need to track click data in the Firebase console and you don't care if the links are long...
Does anybody know the right solution or some trick to achieve this? Any thoughts/ideas would be appreciated!
Seems, that simple appending does work...
When the builder composes the Uri, I append it with &dfl=XXXXX
When I try to open this link on browser PC it directs me to URL in dfl parameter, but on the device, it opens Play Store or app (if it's installed).
The absence of such method confused me, but the solution is found.
I'm using the new buildShortDynamicLink API of Firebase (And it's great).
And i see there are two methodes for the ShortDynamicLink result:
Uri shortLink = task.getResult().getShortLink();
Uri flowchartLink = task.getResult().getPreviewLink();
I tried to use both but still the link doesn't apear in the Firebase dashboard.
What is getPreviewLink used for anyway?
Thanks.
Only analytics for links created in the console will show up in the console.
You can still access the analytics for your short links created via the API by using the Firebase Dynamic Links Rest API as described here (https://firebase.google.com/docs/reference/dynamic-links/analytics).
The getPreview returns the url to a visual flowchart that helps illustrate clearly how the link will work in each context. You can use it to debug the link if you want and to visually see how it will behave in different contexts.
Full disclosure: I work for Firebase.
This is expected. Only links created through the dashboard will show up there.
Think about it from this perspective: when your users are creating hundreds or even thousands of links per day, it will quickly make the dashboard completely useless if they all show up there.
At Branch.io (full disclosure: I'm on the Branch team), we take the same approach by default, though we do offer a manual flag you can change on programmatically-generated links to have them show up on the dashboard if desired.
I am new to Android and am confused on what to put for the URL fields when registering a new client with the Instagram API using their web form.
I'm specifically confused as to what to put for these fields:
Website URL
Valid Redirect URIs
I am making an Android app and it doesn't have a website, so what am I supposed to be putting here?
In my search for an answer that made sense to me, I found this: http://oferei.com/2013/06/serverless-instagram-authentication/
In short, this is what one would need to know about how to fill these fields if they are registering an app that does not have its own website:
Website URL: it doesn't matter what value goes here, I used localhost
Redirect URIs: The article above specifies a custom URI scheme, but this is not supported w/ the Instagram API anymore. However, I did see that also using localhost would work here as well in this article: http://jelled.com/instagram/access-token
Not sure if that is the best practice, but it is a way to get the client ID for an Android app.
I have an android application. I want to implement App Indexing for my App.
I have followed the Google developer links
https://developers.google.com/app-indexing/android/publish
https://developers.google.com/app-indexing/reference/deeplinks
https://developer.android.com/training/app-indexing/deep-linking.html
https://support.google.com/googleplay/android-developer/answer/6041489
I got to know few things from the links
I need to verify my website
Use app indexing API in my Activity
The things that I did not understand
What is the website should I verify?
what should I give for APP_URI & WEB_URL?
static final Uri APP_URI = Uri.parse("android-app://com.example.android.recipes/http/recipe-app.com/recipes");
static final Uri WEB_URL = Uri.parse("http://recipe-app.com/recipes/");
What is the Schema to host my links?
android-app://{package_name}/{scheme}/{host_path}
What is the 'data' should I give in Manifest file.
Think I'm very New to to android development. Any examples are most helpful. Thanks in Advance.
So you already started well using Google's provided example to better understand how App-Indexing works. With that covered, I'd recommend you to follow also the best pratices present here:
https://developer.android.com/training/app-indexing/index.html .
Now, answering to your points:
1- As you saw with Google's example, it is required that your App has corresponding content on the web that has also been indexed by Google. In this case, the website is:
http://recipe-app.com
It would be best if you verify both the app & the website. Information on how to associate your website to your App is present in https://developers.google.com/app-indexing/android/publish
Currently App-Indexing only supports Apps that have correspondent websites. However, if you don't have a website you can still show your interest in support App-Indexing in your App by submitting this form https://developers.google.com/app-indexing/app-only .
2- Google advises to use the App-Indexing API and the HTTP intent scheme as best practices, so in this case you will only need the APP_URI. Also with this kind of implementation, you would not need to make any change on the website markup or sitemap. So in each of your App page you should indicate the APP_URI with the URI of the correspondent content in your website.
3- Assuming you're using the HTTP scheme, your deep link would be similar to this:
android-app://my.app.apk/http/mywebsite.com/sub-domain/content1.html
4- The data parameter on your app's manifest file is where you define the deep link intents that your app supports, so using the example of deep link I provided on 3), it should be similar to this:
<data android:scheme="http"
android:host="mywebsite.com"
android:pathPrefix="/sub-domain" />
This intent will support any web URL that start by:
http://mywebsite.com/sub-domain/
Hope this helps.
I think it would be better as follow:
android-app://my.app.apk/http/sub-domain.mywebsite.com/content1.html