當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。