패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.0.6

facebook_event

Facebook 앱 이벤트용 플러터 플러그인.

AndroidiOS
30일 다운로드
36
좋아요
31
Pub 점수
115

패키지 설치

flutter pub add facebook_event

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

facebook_event 패키지는 사용자 상호작용 및 앱 분석을 위해 Facebook 앱 이벤트와의 통합을 가능하게 하는 플러터 플러그인입니다. 이는 안드로이드 및 iOS 플랫폼에서 플러터 앱에서 구매, 가입, 사용자 정의 작업과 같은 이벤트를 직접 로깅할 수 있게 해줍니다. 플러그인은 다중 플랫폼 간 일관된 API를 제공하여 이벤트 추적을 단순화하고 마케팅 및 성능 분석을 위한 정확한 데이터 수집을 보장합니다. 내부적으로 공식 Facebook SDK를 활용하므로 신뢰할 수 있고 Facebook의 요구사항에 항상 최신 상태를 유지합니다. 이 패키지는 광고 캠페인을 최적화하고 세부 분석을 통해 사용자 행동을 이해하고자 하는 앱에 이상적입니다.

사용 사례

  • 앱 내 구매 추적
  • 사용자 가입 모니터링
  • 사용자 참여도 분석
  • 광고 캠페인 성능 최적화
  • 전환율 측정

주요 기능

  • 크로스 플랫폼 지원 (Android 및 iOS)
  • 간단한 이벤트 로깅 API
  • Facebook SDK 통합
  • 실시간 이벤트 추적
  • 사용자 지정 및 표준 이벤트 지원

적합한 대상

  • 전자상거래 앱
  • 마케팅 중심 애플리케이션
  • 페이스북 광고를 사용하는 앱
  • 분석 기반 개발
  • 사용자 전환 목표를 가진 모바일 앱

고려 사항

  • Facebook 앱 ID 설정이 필요합니다
  • 적절한 권한과 개인정보 보호 준수 필요
  • Facebook SDK 업데이트에 따라 다름
  • 딥 링크를 위해 추가 구성이 필요할 수 있습니다
  • 비페이스북 분석 사용 사례에는 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

facebook_event

pub package

Flutter plugin for Facebook Event and Analytics.

Facebook Events is a feature that can help you organize social gatherings via Facebook. You get a dedicated page for providing all the details of your event plus a range of tools to notify friends about it and keep track of who's going. Facebook Events are different from Facebook Groups and Facebook Pages.

Facebook Analytics is a robust tool that lets marketers explore users' interactions with advanced goal paths and sales funnels for Facebook ads. In this article, you'll discover how to get started with Facebook Analytics.

Installation

You must first create an app at Facebook for developers: https://developers.facebook.com/

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

Android

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)

After that, add that string resource reference to your main AndroidManifest.xml file, directly under the <application> tag.

<meta-data
  android:name="com.facebook.sdk.ApplicationId"
  android:value="your_facebook_app_id_here" />

Example Code

Add code in your android project MainActivity.kt

setAutoLogAppEventsEnabled(true)
FacebookSdk.setAutoInitEnabled(true)
FacebookSdk.fullyInitialize()
setAdvertiserIDCollectionEnabled(true)
FacebookSdk.setIsDebugEnabled(true);
FacebookSdk.addLoggingBehavior(LoggingBehavior.APP_EVENTS);

Example Code

iOS

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>

Example Code

Add code in your android project AppDelegate.swift

ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
AppEvents.activateApp()
AppEvents.logEvent(AppEvents.Name.init(rawValue: "Opened App Main VC"))

Example Code

Get Android HashKey
final facebookEvent = FacebookEvent();
String hashKey='Null';

@override
void initState() {
    // TODO: implement initState
    super.initState();
    if(Platform.isAndroid)
      getHashKey();
}

void getHashKey()async{
    hashKey= await facebookEvent.getAndroidHashKey();
    print(hashKey);
}
All Events
final facebookEvent = FacebookEvent();

// Get facebook application id
facebookEvent.getApplicationId();

/// An app is being activated, typically in the AppDelegate's applicationDidBecomeActive.
facebookEvent.logActivatedApp();

// This event when an app is being deactivated.
facebookEvent.logDeactivatedApp();

// Re-enables auto logging of app events after user consent
facebookEvent.setAutoLogAppEventsEnabled(true);

// Submit user details
facebookEvent.setUserData(
  email:'email',
  firstName:'first name',
  lastName:'last name',
  phone:'phone number',
  dateOfBirth:'dob',
  gender:'gender',
  city:'city',
  state:'state',
  zip:'zip',
  country:'country',
);

// Submit custom event
facebookEvent.logEvent(
    name: 'name',
    body: {'key':'value'},
    valueToSum: 0
);

// Submit contact details
facebookEvent.logContactEvent(contact: 'number');

// A user has viewed a form of content in the app.
facebookEvent.logViewContent(
  content: {'key':'value'},
  id: 'id',
  type: 'type'
);

// The user has completed a purchase. The FB.LogPurchase method is a shortcut for logging this event. specified currency.
facebookEvent.logPurchase(
  amount: 0,
  currency: 'USD',
  body: {'key':'value'}
);

// The user has achieved a level in the app.
facebookEvent.logAchieveLevelEvent(
  level: 'level'
);

// The user has entered their payment info.
facebookEvent.logAddPaymentInfoEvent(
  success: true
);

// The user has added an item to their cart. The valueToSum passed should be the item's price.
facebookEvent.logAddToCartEvent(
  price:0,
  contentData: 'contentData',
  contentType: 'contentType',
  contentId: 'contentId',
  currency: 'USD'
);

// This event when the user has completed registration with the app.
// A user has completed registration with the app.
facebookEvent.logCompleteRegistrationEvent(
  registrationMethod:'registrationMethod',
  name: 'name',
  currency: 'USD'
);

// The user has entered the checkout process. The valueToSum passed should be the total price in the cart.
facebookEvent.logInitiateCheckoutEvent(
  totalPrice:0,
  contentData: 'contentData',
  contentType: 'contentType',
  contentId: 'contentId',
  currency: 'USD',
  numItems: 1,
  paymentInfoAvailable: true
);

// The user has rated an item in the app. The valueToSum passed should be the numeric rating.
facebookEvent.logRateEvent(
  ratingGiven:5,
  contentData: 'contentData',
  contentType: 'contentType',
  contentId: 'contentId',
  maxRatingValue: 5
);

Documentation

You will find all the FB.LogAppEvent details here.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.