gdg-x / frisbee

[DEPRECATED] Android application for GDG members and organizers
https://play.google.com/store/apps/details?id=org.gdg.frisbee.android
Apache License 2.0
265 stars 169 forks source link

Shorten app-invite links #708

Open tasomaniac opened 8 years ago

tasomaniac commented 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.

This example with SHORT param would be feasible. As an API_KEY, our web api key from BuildConfig can be used.

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" }
}