PHP code example of mxl / firebase-dynamic-link

1. Go to this page and download the library: Download mxl/firebase-dynamic-link library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mxl / firebase-dynamic-link example snippets


use MichaelLedin\FirebaseDynamicLink\Android;
use MichaelLedin\FirebaseDynamicLink\DynamicLink;
use MichaelLedin\FirebaseDynamicLink\GooglePlayAnalytics;
use MichaelLedin\FirebaseDynamicLink\IOS;
use MichaelLedin\FirebaseDynamicLink\ITunesConnectAnalytics;
use MichaelLedin\FirebaseDynamicLink\SocialMetaTag;

$dynamicLink = DynamicLink::for('your_subdomain.page.link', 'https://your_domain.com/path/to/page')
    ->withAndroid(
        Android::new()
            ->withPackageName('com.your_domain.app')
            ->withMinimumVersionCode(123)
            ->withFallbackLink('https://your_domain.com/fallback/android')
    )
    ->withIOS(
        IOS::new()
            ->withBundleID('com.your_domain.app')
            ->withMinimumVersionNumber('1.2.3')
            ->withFallbackLink('https://your_domain.com/fallback/ios')
            ->withAppStoreID('app.store.id')
            ->withUrlScheme('customUrlScheme')
            ->withIPadBundleID('com.your_domain.iPadApp')
            ->withIPadFallbackLink('https://your_domain.com/fallback/ipad')
    )
    ->withGooglePlayAnalytics(
        GooglePlayAnalytics::new()
            ->withGclid('gclid')
            ->withUtmCampaign('utm_campaign')
            ->withUtmContent('utm_content')
            ->withUtmMedium('utm_medium')
            ->withUtmSource('utm_source')
            ->withUtmTerm('utm_term')
    )
    ->withITunesConnectAnalytics(
        ITunesConnectAnalytics::new()
            ->withAffiliateToken('affiliate_token')
            ->withCampaignToken('campaign_token')
            ->withMediaType('8')
            ->withProviderToken('provider_token')
    )
    ->withOtherFallbackLink('https://your_domain.com/fallback/other')
    ->withSocialMetaTag(
        SocialMetaTag::new()
            ->withTitle('title')
            ->withImage('https://your_domain.com/img.jpeg')
            ->withDescription('description')
    )
    ->withoutAppPreviewPage()
    ->build();