-
Notifications
You must be signed in to change notification settings - Fork 16
I.3 Create Dynamic Links
There are four ways you can create a Dynamic Link:
- Using the Firebase console. This is useful if you're creating one-off links to share on social media.
- Using the REST API. This is the preferred way to dynamically create links in your app for user-to-user sharing or in any situation that requires many links. You can track the performance of Dynamic Links created with the REST API in the Firebase console.
- Using the built-in link generater method in the ANE. There is a build method in the ANE which you can use to easily create dynamic links supported on iOS/Android with all the other optional parameters required for analytics or social media sharing.
- Manually. If you don't need to track click data in the Firebase console and you don't care if the links are long, you can manually construct Dynamic Links using URL parameters, and by doing so, avoid an extra network round trip.
This is fully explained in Firebase docs. Read here for more information.
This is fully explained in Firebase docs. Read here for more information.
You can use this approach to easily build dynamic links on the fly inside your app.
- Set your deeplink parameters for: Android/iOS/Social Media/Analytics.
- You can decide if you wish the deeplink to be shortened or not.
- call the build method.
- The generated dynamic link will be passed through a method call.
Before you can gerenare a dynamic link using the ANE, you need to set projectID
and webApiKey
. This information can be found inside your Firebase Console.
// init the core first by passing true as an argument so the ANE can prepare itself for dynamic links
var isConfigFound:Boolean = Firebase.init(true);
if (isConfigFound)
{
Firebase.getConfig().projectID = "fir-proj";
Firebase.getConfig().webApiKey = "AIzbSyDvWwo5ATJ3pPl3YG1MHlQsikuodVzdehQ";
}
Now you're ready to call the build
method.
// optional: set Android parameters
var androidParams:AndroidParams = new AndroidParams();
androidParams.apn = "air." + NativeApplication.nativeApplication.applicationID;
androidParams.amv = 3;
// other parameters...
// optional: set iOS parameters
var iosParams:IosParams = new IosParams();
iosParams.ibi = NativeApplication.nativeApplication.applicationID;
iosParams.isi = "1243765712";
// other parameters...
// optional: set Social Media parameters
var socialMediaParams:SocialMediaParams = new SocialMediaParams();
socialMediaParams.st = "my Social Media title";
socialMediaParams.sd = "my Social Media description";
// other parameters...
// optional: set analytics parametera
var analyticsParams:AnalyticsParams = new AnalyticsParams();
// other parameters...
DynamicLinks.api.build( "r27kf", // your app-code
"http://www.myflashlabs.com/deeplinks", // the url which you can use to decide where to take your users when dynamic link is received
false, // Boolean to decide if you want the deeplink be shortened or not
androidParams,
iosParams,
socialMediaParams,
analyticsParams,
onDeeplinkBuiltDone); // a function which will be called when deeplink is generated
function onDeeplinkBuiltDone($deeplink:String, $raw:String):void
{
if ($raw)
{
trace("$raw = " + $raw);
}
if($deeplink)
{
trace("_deepLink = " + $deeplink);
}
}
NOTE: Only club members have access to the DynamicLinks.api property.
Enjoy building Air apps – With ♥ from MyFlashLabs Team
Introduction to Firebase ANEs collection for Adobe Air apps
Get Started with Firebase Core in AIR
- Prerequisites
- Add Firebase to your app
- Add the Firebase SDK
- Init Firebase Core
- Available ANEs
- Managing Firebase iid
Get Started with Authentication
- Add Authentication
- Init Authentication
- Manage Users
- Phone Number
- Custom Auth
- Anonymous Auth
- State in Email Actions
- Email Link Authentication
Get Started with FCM + OneSignal
- Add FCM ANE
- Init FCM ANE
- Send Your 1st Message
- Send Msg to Topics
- Understanding FCM Messages
- init OneSignal
- Add Firestore
- Init Firestore
- Add Data
- Transactions & Batches
- Delete Data
- Manage the Console
- Get Data
- Get Realtime Updates
- Simple and Compound
- Order and Limit Data
- Paginate Data
- Manage Indexes
- Secure Data
- Offline Data
- Where to Go From Here
Get Started with Realtime Database
- Add Realtime Database
- Init Realtime Database
- Structure Your Database
- Save Data
- Retrieve Data
- Enable Offline Capabilities
Get Started with Remote Config
- Add Storage ANE
- Init Storage ANE
- Upload Files to Storage
- Download Files to Air
- Use File Metadata
- Delete Files