Open tasomaniac opened 8 years ago
Firebase finally allows dynamic long urls to be shorten via a REST api. Unfortunately this is not available in the SDK yet. But it is not hard to do. Hopefully this will make our share urls a little bit nicer.
Here is more info: https://firebase.google.com/docs/dynamic-links/short-links
I think a best way to do it would be to display a ProgressDialog to shorten the url. Then we can fire share intent.
ProgressDialog
This example with SHORT param would be feasible. As an API_KEY, our web api key from BuildConfig can be used.
BuildConfig
POST https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=api_key Content-Type: application/json { "longDynamicLink": "https://abc123.app.goo.gl/?link=http://example.com/&apn=com.example.android&ibi=com.example.ios", "suffix": { "option": "SHORT" } }
Firebase finally allows dynamic long urls to be shorten via a REST api. Unfortunately this is not available in the SDK yet. But it is not hard to do. Hopefully this will make our share urls a little bit nicer.
Here is more info: https://firebase.google.com/docs/dynamic-links/short-links
I think a best way to do it would be to display a
ProgressDialog
to shorten the url. Then we can fire share intent.This example with SHORT param would be feasible. As an API_KEY, our web api key from
BuildConfig
can be used.