mxl/firebase-dynamic-link

手动构建动态链接URL

v1.0.1 2020-07-23 06:16 UTC

This package is auto-updated.

Last update: 2024-09-23 20:43:49 UTC


README

Current version Monthly Downloads Total Downloads Build Status

PHP的Firebase动态链接URL构建器。

构建动态链接,如此处所述。

要通过Firebase API创建动态链接,请使用kreait/firebase-php

安装

$ composer require mxl/firebase-dynamic-link

用法

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();

维护者

作者的其他有用PHP库

许可证

有关详细信息,请参阅LICENSE文件。