搜尋套件、儲存庫與 APP 分類

套件詳情v3.1.0

flutter_facebook_app_links

一個 Flutter 外掛程式,使用 FB App Links SDK 捕獲來自 Facebook 廣告的延遲深度連結。

AndroidiOS
近 30 天下載
2900
喜歡數
41
Pub 分數
140

安裝套件

flutter pub add flutter_facebook_app_links

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 插件,可讓應用透過 Facebook App Links SDK 接收並處理來自 Facebook 廣告的延遲深度連結。此插件讓開發者能夠追蹤使用者從 Facebook 廣告活動中的互動行為,並在應用尚未安裝的情況下,將使用者導向應用內的特定內容。該插件支援 Android 與 iOS 平台,確保與 Facebook 的歸因與深度連結基礎架構無縫整合。

適用情境

  • 處理 Facebook 廣告點擊重定向
  • 透過深度連結追蹤廣告系列表現
  • 啟用安裝後深度連結
  • 透過目標廣告支援重新參與
  • 促進個人化使用者體驗

主要特色

  • 延遲深度連結支援
  • Facebook 應用連結 SDK 集成
  • 跨平台(Android 與 iOS)
  • 用於連結處理的簡單 API
  • 應用啟動時自動捕獲連結

適合對象

  • 使用 Facebook 廣告的行銷團隊
  • 需要活動歸因的應用
  • 開發用於推薦或入職流程的開發者
  • 具有動態內容定位的產品
  • 專注於用戶獲取的移動應用

使用建議

  • 需要在 Facebook 開發者控制台中設定 Facebook App Links
  • 需要正確的 URL 方案和應用連結設定
  • 某些設備可能需要額外的權限
  • 僅限 Facebook 廣告來源
  • 依賴於 Facebook SDK 版本相容性

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutter Facebook App Links

Flutter plugin for Facebook App Links SDK. This plugin must be used to catch deferred deeplinks sent from Facebook after your app has been installed from a FB ADS.

Getting Started

First of all, if you don't have one already, you must first create an app at Facebook developers: https://developers.facebook.com/

Get your app id (referred to as [APP_ID] below)

Configure Android

For Android configuration, you can follow the same instructions of the Flutter Facebook App Events plugin: Read through the "Getting Started with App Events for Android" tutuorial and in particular, follow step 2 by adding the following into /app/res/values/strings.xml (or into respective debug or release build flavor)

configure inside android/app/main/res/values/strings.xml the above values (without square brackets):

<string name="facebook_app_id">[your_app_id]</string>
<string name="facebook_client_token">[your_client_token]</string>

then, add that string resource reference to your main AndroidManifest.xml file, within ...

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
Configure iOS

For iOS configuration, you can follow the same instructions of the Flutter Facebook App Events plugin: Read through the "Getting Started with App Events for iOS" tutuorial and in particular, follow step 4 by opening info.plist "As Source Code" and add the following

  • If your code does not have CFBundleURLTypes, add the following just before the final </dict> element:
<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
    <string>fb[APP_ID]</string>
  </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>[APP_ID]</string>
<key>FacebookDisplayName</key>
<string>[APP_NAME]</string>
  • If your code already contains CFBundleURLTypes, insert the following:
<array>
 <dict>
 <key>CFBundleURLSchemes</key>
 <array>
   <string>fb[APP_ID]</string>
 </array>
 </dict>
</array>
<key>FacebookAppID</key>
<string>[APP_ID]</string>
<key>FacebookDisplayName</key>
<string>[APP_NAME]</string>

## How to use

import 'dart:io' show Platform;
...
...
/// FB Deferred Deeplinks
void initFBDeferredDeeplinks() async {

  String deepLinkUrl;
  // Platform messages may fail, so we use a try/catch PlatformException.
  try {

    deepLinkUrl = await FlutterFacebookAppLinks.initFBLinks();
    if(Platform.isIOS)
      deepLinkUrl = await FlutterFacebookAppLinks.getDeepLink();

    /// do what you need with the deeplink...
    /// ...
  }catche(e){
    /// in case of error...
  }
}

About Facebook App Links

Please refer to the official SDK documentation for Android and iOS.

IMPORTANT NOTES

User privacy [DO NOT IGNORE]

How documented on Facebook docs, starting from v5.0.0 of the SDK, they introduce a flag for disabling automatic SDK initialization to be GDPR compliant. It means that you should collect user consent before you use call the method initFBLinks() of this plugin and save the user choice. Moreover, you should give the user a chance to revoke their consent in the future. Please keep in mind that this plugin uses FacebookSDK.setAutoInitEnabled(true) in Android and Settings.isAutoInitEnabled = true in iOS by default, so the consent must be granted in your Dart code before you call FlutterFacebookAppLinks.initFBLinks().

Testing deferred deep links

To correctly test deferred deeplinks, DO NOT use the preview of your FB ADS campaign. Instead, use this tool APP ADS HELPER

At the end of the page you will find a "Test deep link" button, click on it and type your custom url scheme (deeplink), for example: myawesomeapp://screen/login

Select the second checkbox (or both). Remember that to make it works, you'll need the Facebook app installed on your device (Android or iPhone) and you must be logged in with the same account you're using in the Facebook Developers console.

Your app doesn't need to be published on the store, simply uninstall it and re-install using Android Studio/VSCode or XCode after you've sent the deferred deep link.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。