Skip to content

Certain custom events dont fire[Issue]:  #257

Description

@tauqeer-cs

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

We have made a class in which we have static method to log the fb custom event. We almost get all the events but there is some specific event that never trigger for us. For example RegisterPersonalDetails is events is never shows up on events page but we also dont get any exception too.

Example of how we call out static method

  AnalyticService.logEvent(name: "RegisterPersonalDetails");

Class code.

import 'package:facebook_app_events/facebook_app_events.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:gopayz/application.dart';
import 'package:logging/logging.dart';

class AnalyticService{

  final facebookAnalytics = FacebookAppEvents();

  static AnalyticService _instance = AnalyticService._();
  AnalyticService._();

  static void init() async{
    await _instance.facebookAnalytics.setAdvertiserTracking(enabled: true);
    await _instance.facebookAnalytics.setAutoLogAppEventsEnabled(true);
  }

  static void logEvent({ String ? name,  Map<String, Object?> ? parameters}) async {
    if(name.isNullOrEmpty()){
      return;
    }
    try{
      await _instance.facebookAnalytics.logEvent(name: name!,parameters: parameters);
      debugPrint("===Send Analytic: $name====");
    }catch(e){
      debugPrint("===Error Analytic: $e");
    }
  }
}

Expected Behavior

The problem is commen with iOS and Android.
Call AnalyticService.logEvent(name: "RegisterPersonalDetails").

Steps To Reproduce

Using facebook_app_events: ^0.16.0
Call

Platform

Android

Flutter Doctor

[✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-PK)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

One thing I am using fvm and this project is on 2.10.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐞Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions