当前位置: 首页>>代码示例>>Java>>正文


Java AppEventsLogger.newLogger方法代码示例

本文整理汇总了Java中com.facebook.appevents.AppEventsLogger.newLogger方法的典型用法代码示例。如果您正苦于以下问题:Java AppEventsLogger.newLogger方法的具体用法?Java AppEventsLogger.newLogger怎么用?Java AppEventsLogger.newLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.appevents.AppEventsLogger的用法示例。


在下文中一共展示了AppEventsLogger.newLogger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LoginLogger

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
LoginLogger(Context context, String applicationId) {
    this.applicationId = applicationId;

    appEventsLogger = AppEventsLogger.newLogger(context, applicationId);

    // Store which version of facebook is installed
    try {
        PackageManager packageManager = context.getPackageManager();
        if (packageManager != null) {
            PackageInfo facebookInfo = packageManager.getPackageInfo(FACEBOOK_PACKAGE_NAME, 0);
            if (facebookInfo != null) {
                facebookVersion = facebookInfo.versionName;
            }
        }
    } catch (PackageManager.NameNotFoundException e) {
        // Do nothing, just ignore and not log
    }
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:19,代码来源:LoginLogger.java

示例2: onCreate

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  tokenInvalidator =
      ((AptoideApplication) getContext().getApplicationContext()).getTokenInvalidator();
  storeCredentialsProvider = new StoreCredentialsProviderImpl(AccessorFactory.getAccessorFor(
      ((AptoideApplication) getContext().getApplicationContext()
          .getApplicationContext()).getDatabase(), cm.aptoide.pt.database.realm.Store.class));
  accountManager =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountManager();
  bodyInterceptor =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountSettingsBodyInterceptorPoolV7();
  httpClient = ((AptoideApplication) getContext().getApplicationContext()).getDefaultClient();
  converterFactory = WebService.getDefaultConverter();
  storeAnalytics =
      new StoreAnalytics(AppEventsLogger.newLogger(getContext()), Analytics.getInstance());
  widgetsUtils = new WSWidgetsUtils();
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:18,代码来源:MyStoresSubscribedFragment.java

示例3: onCreate

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
@Override public void onCreate() {
  super.onCreate();
  Logger.d(TAG, "Install service is starting");
  final AptoideApplication application = (AptoideApplication) getApplicationContext();
  marketName = application.getMarketName();
  downloadManager = application.getDownloadManager();
  final MinimalAdMapper adMapper = new MinimalAdMapper();
  InstallerFactory installerFactory = new InstallerFactory(adMapper,
      new InstallFabricEvents(Analytics.getInstance(), Answers.getInstance(),
          AppEventsLogger.newLogger(getApplicationContext())), application.getImageCachePath());
  defaultInstaller = installerFactory.create(this, InstallerFactory.DEFAULT);
  rollbackInstaller = installerFactory.create(this, InstallerFactory.ROLLBACK);
  installManager =
      ((AptoideApplication) getApplicationContext()).getInstallManager(InstallerFactory.ROLLBACK);
  subscriptions = new CompositeSubscription();
  setupNotification();
  installerTypeMap = new HashMap();
  analytics = Analytics.getInstance();
  installedRepository = RepositoryFactory.getInstalledRepository(getApplicationContext());
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:21,代码来源:InstallService.java

示例4: onCreate

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
@Override public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  AptoideApplication application = (AptoideApplication) getContext().getApplicationContext();
  sharedPreferences = application.getDefaultSharedPreferences();
  tokenInvalidator = application.getTokenInvalidator();
  baseBodyBodyInterceptor = application.getAccountSettingsBodyInterceptorPoolV7();
  httpClient = application.getDefaultClient();
  converterFactory = WebService.getDefaultConverter();
  onEmptyTextError =
      AptoideUtils.StringU.getResString(R.string.ws_error_MARG_107, getContext().getResources());
  Analytics analytics = Analytics.getInstance();
  timelineAnalytics = new TimelineAnalytics(analytics,
      AppEventsLogger.newLogger(getContext().getApplicationContext()),
      application.getAccountSettingsBodyInterceptorPoolV7(), httpClient, converterFactory,
      tokenInvalidator, BuildConfig.APPLICATION_ID, application.getDefaultSharedPreferences(),
      application.getNotificationAnalytics(), application.getNavigationTracker(),
      application.getReadPostsPersistence());
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:19,代码来源:CommentDialogFragment.java

示例5: logShareResult

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
private static void logShareResult(String shareOutcome, String errorMessage) {
    Context context = FacebookSdk.getApplicationContext();
    AppEventsLogger logger = AppEventsLogger.newLogger(context);
    Bundle parameters = new Bundle();
    parameters.putString(
            AnalyticsEvents.PARAMETER_SHARE_OUTCOME,
            shareOutcome
    );

    if (errorMessage != null) {
        parameters.putString(AnalyticsEvents.PARAMETER_SHARE_ERROR_MESSAGE, errorMessage);
    }
    logger.logSdkEvent(AnalyticsEvents.EVENT_SHARE_RESULT, null, parameters);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:15,代码来源:ShareInternalUtility.java

示例6: logWebLoginCompleted

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
protected void logWebLoginCompleted(String e2e) {
    String applicationId = loginClient.getPendingRequest().getApplicationId();
    AppEventsLogger appEventsLogger =
            AppEventsLogger.newLogger(loginClient.getActivity(), applicationId);

    Bundle parameters = new Bundle();
    parameters.putString(AnalyticsEvents.PARAMETER_WEB_LOGIN_E2E, e2e);
    parameters.putLong(
            AnalyticsEvents.PARAMETER_WEB_LOGIN_SWITCHBACK_TIME, System.currentTimeMillis());
    parameters.putString(AnalyticsEvents.PARAMETER_APP_ID, applicationId);

    appEventsLogger.logSdkEvent(AnalyticsEvents.EVENT_WEB_LOGIN_COMPLETE, null, parameters);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:14,代码来源:LoginMethodHandler.java

示例7: logDialogActivity

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
public static void logDialogActivity(
        Context context,
        String eventName,
        String outcome) {
    AppEventsLogger logger = AppEventsLogger.newLogger(context);
    Bundle parameters = new Bundle();
    parameters.putString(AnalyticsEvents.PARAMETER_DIALOG_OUTCOME, outcome);
    logger.logSdkEvent(eventName, null, parameters);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:10,代码来源:DialogPresenter.java

示例8: onReceive

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    AppEventsLogger appEventsLogger = AppEventsLogger.newLogger(context);
    String eventName = BOLTS_MEASUREMENT_EVENT_PREFIX +
            intent.getStringExtra(MEASUREMENT_EVENT_NAME_KEY);
    Bundle eventArgs = intent.getBundleExtra(MEASUREMENT_EVENT_ARGS_KEY);
    Bundle logData = new Bundle();
    for(String key : eventArgs.keySet()) {
       String safeKey = key.replaceAll(
               "[^0-9a-zA-Z _-]", "-").replaceAll("^[ -]*", "").replaceAll("[ -]*$", "");
       logData.putString(safeKey, (String)eventArgs.get(key));
    }
    appEventsLogger.logEvent(eventName, logData);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:15,代码来源:BoltsMeasurementEventListener.java

示例9: logFacebookAnalytics

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
private static void logFacebookAnalytics(Context context, String eventName, Bundle bundle) {
    AppEventsLogger facebook = AppEventsLogger.newLogger(context);
    if (bundle == null || bundle.isEmpty()) {
        facebook.logEvent(eventName);
    } else {
        facebook.logEvent(eventName, bundle);
    }
}
 
开发者ID:Turistforeningen,项目名称:SjekkUT,代码行数:9,代码来源:Analytics.java

示例10: onViewCreated

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);
  handleOnBackKeyPressed();

  FirstInstallAnalytics firstInstallAnalytics = new FirstInstallAnalytics(Analytics.getInstance(),
      AppEventsLogger.newLogger(getContext().getApplicationContext()));
  firstInstallAnalytics.sendPopupEvent();

  attachPresenter(
      new FirstInstallPresenter(this, CrashReport.getInstance(), requestFactoryCdnPool,
          getContext(), ((PartnerApplication) getApplicationContext()).getBootConfig()
          .getPartner()
          .getStore()
          .getName(), "",
          ((AptoideApplication) getContext().getApplicationContext()).getAdsRepository(),
          getContext().getResources(),
          (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE),
          RepositoryFactory.getAppRepository(getContext(),
              ((AptoideApplication) getContext().getApplicationContext()).getDefaultSharedPreferences()),
          firstInstallAnalytics, new PermissionManager(), this,
          ((AptoideApplication) getApplicationContext()).getInstallManager(
              InstallerFactory.ROLLBACK), new MinimalAdMapper(),
          ((AptoideApplication) getApplicationContext()).getDefaultClient(),
          WebService.getDefaultConverter(),
          ((AptoideApplication) getApplicationContext()).getQManager(),
          AccessorFactory.getAccessorFor(
              ((AptoideApplication) getApplicationContext().getApplicationContext()).getDatabase(),
              StoredMinimalAd.class)));
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:30,代码来源:FirstInstallFragment.java

示例11: getNotificationCenter

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
public NotificationCenter getNotificationCenter() {
  if (notificationCenter == null) {
    final NotificationProvider notificationProvider = getNotificationProvider();
    notificationCenter =
        new NotificationCenter(notificationProvider, getNotificationSyncScheduler(),
            new NotificationPolicyFactory(notificationProvider),
            new NotificationAnalytics(Analytics.getInstance(),
                AppEventsLogger.newLogger(getApplicationContext()), bodyInterceptorPoolV7,
                getDefaultClient(), WebService.getDefaultConverter(), tokenInvalidator,
                cm.aptoide.pt.dataprovider.BuildConfig.APPLICATION_ID,
                getDefaultSharedPreferences(), new AptoideInstallParser()));
  }
  return notificationCenter;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:15,代码来源:AptoideApplication.java

示例12: onCreateView

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
    Bundle savedInstanceState) {

  loadArguments();

  View view = inflater.inflate(R.layout.dialog_comment_on_review, container);

  TextView titleTextView = (TextView) view.findViewById(R.id.title);
  titleTextView.setVisibility(View.VISIBLE);

  switch (commentType) {
    case REVIEW:
      titleTextView.setText(getString(R.string.dialog_title_comment));
      break;
    case TIMELINE:
      titleTextView.setText(getString(R.string.dialog_title_comment));
      break;
    case STORE:
      titleTextView.setText(
          TextUtils.isEmpty(appOrStoreName) ? getString(R.string.comment_store_title)
              : getString(R.string.commentlist_title_comment_on_store, appOrStoreName));
      break;
  }

  Button cancelButton = (Button) view.findViewById(R.id.cancel_button);
  cancelButton.setOnClickListener(a -> {
    logAnalytics(false);
    CommentDialogFragment.this.dismiss();
  });

  textInputLayout = (TextInputLayout) view.findViewById(R.id.input_layout_title);
  commentButton = (Button) view.findViewById(R.id.comment_button);

  setupLogic();
  storeAnalytics =
      new StoreAnalytics(AppEventsLogger.newLogger(getContext().getApplicationContext()),
          Analytics.getInstance());

  return view;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:41,代码来源:CommentDialogFragment.java

示例13: prepareTrackersAndFbLogger

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
/**
 * Prepare Google analytics trackers and Facebook events logger.
 * Send UTM campaign if exist.
 *
 * @param shop    shop with app specific Google Ua or null, if global tracker is enough.
 * @param context application context.
 */
public static synchronized void prepareTrackersAndFbLogger(Shop shop, Context context) {
    GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
    // To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG

    if (shop == null) {
        deleteAppTrackers();
    } else {
        if (!mTrackers.containsKey(TRACKER_APP) && analytics != null) {
            if (shop.getGoogleUa() != null && !shop.getGoogleUa().isEmpty()) {
                Timber.d("Set new app tracker with id: %s", shop.getGoogleUa());
                // App tracker determined by shop
                Tracker appTracker = analytics.newTracker(shop.getGoogleUa());
                appTracker.enableAutoActivityTracking(true);
                appTracker.enableExceptionReporting(false);
                appTracker.enableAdvertisingIdCollection(true);
                mTrackers.put(TRACKER_APP, appTracker);
            } else {
                Timber.e(new RuntimeException(), "Creating GA app tracker with empty Google UA");
            }
        } else {
            Timber.e("Trackers for this app already exist.");
        }
    }

    // Add global tracker only one time.
    if (!mTrackers.containsKey(TRACKER_GLOBAL) && analytics != null) {
        Timber.d("Set new global tracker.");
        // Global app tracker
        Tracker appTrackerGlobal = analytics.newTracker(R.xml.global_tracker);
        appTrackerGlobal.enableAutoActivityTracking(true);
        appTrackerGlobal.enableExceptionReporting(true);
        appTrackerGlobal.enableAdvertisingIdCollection(true);
        mTrackers.put(TRACKER_GLOBAL, appTrackerGlobal);
        // Send camping info only once time.
        sendCampaignInfo();
    }

    facebookLogger = AppEventsLogger.newLogger(MyApplication.getInstance());
}
 
开发者ID:openshopio,项目名称:openshop.io-android,代码行数:47,代码来源:Analytics.java

示例14: onCreate

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  final AptoideApplication application =
      (AptoideApplication) getContext().getApplicationContext();

  defaultThemeName = application.getDefaultThemeName();
  final SearchManager searchManager =
      (SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE);

  final SearchNavigator searchNavigator =
      new SearchNavigator(getFragmentNavigator(), application.getDefaultStoreName());

  final Analytics analytics = Analytics.getInstance();
  issuesAnalytics = new IssuesAnalytics(analytics, Answers.getInstance());

  searchBuilder = new SearchBuilder(searchManager, searchNavigator);

  drawerAnalytics = new DrawerAnalytics(analytics,
      AppEventsLogger.newLogger(getContext().getApplicationContext()));
  installedRepository =
      RepositoryFactory.getInstalledRepository(getContext().getApplicationContext());
  pageViewsAnalytics =
      new PageViewsAnalytics(AppEventsLogger.newLogger(getContext().getApplicationContext()),
          analytics, navigationTracker);
  setRegisterFragment(false);
  setHasOptionsMenu(true);
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:29,代码来源:HomeFragment.java

示例15: getNotLoggedInShareAnalytics

import com.facebook.appevents.AppEventsLogger; //导入方法依赖的package包/类
public NotLoggedInShareAnalytics getNotLoggedInShareAnalytics() {
  if (notLoggedInShareAnalytics == null) {
    notLoggedInShareAnalytics =
        new NotLoggedInShareAnalytics(getAccountAnalytics(), AppEventsLogger.newLogger(this),
            Analytics.getInstance());
  }
  return notLoggedInShareAnalytics;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:9,代码来源:AptoideApplication.java


注:本文中的com.facebook.appevents.AppEventsLogger.newLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。