Java 类com.facebook.appevents.AppEventsLogger 实例源码

项目:kognitivo    文件:LoginLogger.java   
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
    }
}
项目:Stalker    文件:AuthenticateFragment.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp(getActivity().getApplication());
    }
    // Initialize Firebase Auth
    fireBaseAuth = FirebaseAuth.getInstance();
    fireBaseAuth.signOut();

    facebookCallbackManager = CallbackManager.Factory.create();
    registerFirebase();
    registerFacebookCallback();
    LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("email", "public_profile"));
}
项目:BizareChat    文件:BizareChatApp.java   
@Override
    public void onCreate() {
        super.onCreate();
        if (BuildConfig.CRASH_REPORTS) {
            Fabric.with(this, new Crashlytics());
        }

        INSTANCE = this;

//        if(LeakCanary.isInAnalyzerProcess(this))
//            return;
//        LeakCanary.install(this);
        FacebookSdk.sdkInitialize(getApplicationContext());

        AppEventsLogger.activateApp(this);
        UserToken.getInstance().initSharedPreferences(this);

    }
项目:Project-Chao    文件:Chao.java   
@Override public void onCreate() {
  super.onCreate();
  sInstance = this;

  RealmConfiguration configuration =
      new RealmConfiguration.Builder(this).deleteRealmIfMigrationNeeded()
          .migration(new RealmMigration() {
            @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
            }
          })
          .name("chao.realm")
          .build();

  Realm.setDefaultConfiguration(configuration);

  Stetho.initialize(Stetho.newInitializerBuilder(this)
      .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
      .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
      .build());

  FacebookSdk.sdkInitialize(getApplicationContext());
  AppEventsLogger.activateApp(this);
}
项目:Stalker    文件:AuthenticateFragment.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp(getActivity().getApplication());
    }
    // Initialize Firebase Auth
    fireBaseAuth = FirebaseAuth.getInstance();
    fireBaseAuth.signOut();

    facebookCallbackManager = CallbackManager.Factory.create();
    registerFirebase();
    registerFacebookCallback();
    LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("email", "public_profile"));
}
项目:android-oss    文件:ApplicationLifecycleUtil.java   
@Override
public void onActivityResumed(final @NonNull Activity activity) {
  if(this.isInBackground){
    this.koala.trackAppOpen();

    // Facebook: logs 'install' and 'app activate' App Events.
    AppEventsLogger.activateApp(activity);

    // Refresh the config file
    this.client.config()
      .compose(Transformers.pipeApiErrorsTo(this::handleConfigApiError))
      .compose(Transformers.neverError())
      .subscribe(c -> this.config.config(c));

    this.isInBackground = false;
  }
}
项目:FindMeAHome    文件:SplashActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    //FacebookSdk.sdkInitialize(getApplicationContext());
    AppEventsLogger.activateApp(getApplication());

    auth = FirebaseAuth.getInstance();
    user = auth.getCurrentUser();
    getDatabase();
    auth.addAuthStateListener(authListener);

    if (user == null) { // If there isn't a user account registered, I'm anonymous
        registerAnonymousUser();
    }

    goToNextActivity();
}
项目:aptoide-client-v8    文件:UpdatesFragment.java   
private void setInstalled(List<Installed> installedApps) {
  installedDisplayablesList.clear();
  installedDisplayablesList.add(new StoreGridHeaderDisplayable(
      new GetStoreWidgets.WSWidget().setTitle(
          AptoideUtils.StringU.getResString(R.string.updatetab_title_installed,
              getContext().getResources())), storeTabNavigator, navigationTracker));

  for (Installed installedApp : installedApps) {
    AptoideApplication application = (AptoideApplication) getContext().getApplicationContext();
    installedDisplayablesList.add(new InstalledAppDisplayable(installedApp,
        new TimelineAnalytics(analytics, AppEventsLogger.newLogger(getContext()),
            bodyInterceptorV7, httpClient, converterFactory, tokenInvalidator,
            BuildConfig.APPLICATION_ID, application.getDefaultSharedPreferences(),
            application.getNotificationAnalytics(), navigationTracker,
            application.getReadPostsPersistence()), installedRepository));
  }
  addDisplayables(installedDisplayablesList, false);
  Logger.v(TAG, "listed installed apps");
}
项目:aptoide-client-v8    文件:AptoideApplication.java   
public InstallManager getInstallManager(int installerType) {

    if (installManagers == null) {
      installManagers = new SparseArray<>();
    }

    InstallManager installManager = installManagers.get(installerType);
    if (installManager == null) {

      installManager = new InstallManager(getApplicationContext(), getDownloadManager(),
          new InstallerFactory(new MinimalAdMapper(),
              new InstallFabricEvents(Analytics.getInstance(), Answers.getInstance(),
                  AppEventsLogger.newLogger(this)), getImageCachePath()).create(this,
              installerType), getRootAvailabilityManager(), getDefaultSharedPreferences(),
          SecurePreferencesImplementation.getInstance(getApplicationContext(),
              getDefaultSharedPreferences()),
          RepositoryFactory.getDownloadRepository(getApplicationContext().getApplicationContext()),
          RepositoryFactory.getInstalledRepository(
              getApplicationContext().getApplicationContext()));
      installManagers.put(installerType, installManager);
    }

    return installManager;
  }
项目:aptoide-client-v8    文件:PhoneInputFragment.java   
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  final BodyInterceptor<BaseBody> baseBodyInterceptor =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountSettingsBodyInterceptorPoolV7();
  final OkHttpClient httpClient =
      ((AptoideApplication) getContext().getApplicationContext()).getDefaultClient();
  final Converter.Factory converterFactory = WebService.getDefaultConverter();
  marketName = application.getMarketName();
  this.mActionsListener = new PhoneInputPresenter(this,
      new ContactsRepository(baseBodyInterceptor, httpClient, converterFactory,
          ((AptoideApplication) getContext().getApplicationContext()).getIdsRepository(),
          new ContactUtils(
              (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE),
              getContext().getContentResolver()),
          ((AptoideApplication) getContext().getApplicationContext()).getTokenInvalidator(),
          ((AptoideApplication) getContext().getApplicationContext()).getDefaultSharedPreferences()),
      new AddressBookAnalytics(Analytics.getInstance(),
          AppEventsLogger.newLogger(getContext().getApplicationContext())),
      new AddressBookNavigationManager(getFragmentNavigator(), entranceTag,
          getString(R.string.addressbook_about),
          getString(R.string.addressbook_data_about, marketName)));
  mGenericPleaseWaitDialog = GenericDialogs.createGenericPleaseWaitDialog(getContext());
  contactUtils = new ContactUtils(
      (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE),
      getContext().getContentResolver());
}
项目:apparel    文件:ApparelApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Fresco.initialize(this);

    FacebookSdk.sdkInitialize(getApplicationContext());

    AppEventsLogger.activateApp(this);

    ContentResolver.addPeriodicSync(
            AuthenticationManager.getSyncAccount(getApplicationContext()),
            ApparelContract.AUTHORITY,
            Bundle.EMPTY,
            SYNC_INTERVAL);

}
项目:aptoide-client-v8    文件:CommentDialogFragment.java   
@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());
}
项目:aptoide-client-v8    文件:CommentListFragment.java   
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  //this object is used in loadExtras and loadExtras is called in the super
  AptoideApplication application = (AptoideApplication) getContext().getApplicationContext();
  sharedPreferences = application.getDefaultSharedPreferences();
  tokenInvalidator = application.getTokenInvalidator();
  storeCredentialsProvider = new StoreCredentialsProviderImpl(AccessorFactory.getAccessorFor(
      ((AptoideApplication) getContext().getApplicationContext()
          .getApplicationContext()).getDatabase(), Store.class));
  httpClient = application.getDefaultClient();
  converterFactory = WebService.getDefaultConverter();
  bodyInterceptor = application.getAccountSettingsBodyInterceptorPoolV7();
  final Analytics analytics = Analytics.getInstance();
  timelineAnalytics = new TimelineAnalytics(analytics,
      AppEventsLogger.newLogger(getContext().getApplicationContext()), bodyInterceptor,
      httpClient, converterFactory, tokenInvalidator, BuildConfig.APPLICATION_ID,
      application.getDefaultSharedPreferences(), application.getNotificationAnalytics(),
      navigationTracker, application.getReadPostsPersistence());
  super.onCreate(savedInstanceState);
  setHasOptionsMenu(true);
}
项目:aptoide-client-v8    文件:InboxFragment.java   
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);
  list = (RecyclerView) view.findViewById(R.id.fragment_inbox_list);
  list.setAdapter(adapter);
  list.setLayoutManager(new LinearLayoutManager(getContext()));

  AptoideApplication application = ((AptoideApplication) getContext().getApplicationContext());
  attachPresenter(
      new InboxPresenter(this, ((ActivityResultNavigator) getContext()).getInboxNavigator(),
          ((AptoideApplication) getContext().getApplicationContext()).getNotificationCenter(),
          CrashReport.getInstance(),
          ((AptoideApplication) getContext().getApplicationContext()).getNavigationTracker(),
          application.getNotificationAnalytics(),
          new PageViewsAnalytics(AppEventsLogger.newLogger(getContext().getApplicationContext()),
              Analytics.getInstance(), navigationTracker), AndroidSchedulers.mainThread()));
}
项目:aptoide-client-v8    文件:PostFragment.java   
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  final AptoideApplication application =
      (AptoideApplication) getContext().getApplicationContext();
  installedRepository = RepositoryFactory.getInstalledRepository(getContext());
  cancelClick = PublishRelay.create();
  postClick = PublishRelay.create();
  loginAction = PublishRelay.create();
  openUploaderButton = PublishRelay.create();
  SharedPreferences sharedPreferences =
      ((AptoideApplication) getContext().getApplicationContext()).getDefaultSharedPreferences();
  TokenInvalidator tokenInvalidator =
      ((AptoideApplication) getContext().getApplicationContext()).getTokenInvalidator();
  BodyInterceptor<BaseBody> bodyInterceptor =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountSettingsBodyInterceptorPoolV7();
  OkHttpClient okHttpClient =
      ((AptoideApplication) getContext().getApplicationContext()).getDefaultClient();
  Converter.Factory converterFactory = WebService.getDefaultConverter();

  analytics = new PostAnalytics(Analytics.getInstance(),
      AppEventsLogger.newLogger(getContext().getApplicationContext()), bodyInterceptor,
      okHttpClient, converterFactory, tokenInvalidator, BuildConfig.APPLICATION_ID,
      sharedPreferences, application.getNavigationTracker());
  handleAnalytics();
  setHasOptionsMenu(true);
}
项目:aptoide-client-v8    文件:TimelineAnalytics.java   
public TimelineAnalytics(Analytics analytics, AppEventsLogger facebook,
    BodyInterceptor<BaseBody> bodyInterceptor, OkHttpClient httpClient,
    Converter.Factory converterFactory, TokenInvalidator tokenInvalidator, String appId,
    SharedPreferences sharedPreferences, NotificationAnalytics notificationAnalytics,
    NavigationTracker navigationTracker, ReadPostsPersistence readPostsPersistence) {
  this.analytics = analytics;
  this.facebook = facebook;
  this.bodyInterceptor = bodyInterceptor;
  this.httpClient = httpClient;
  this.converterFactory = converterFactory;
  this.tokenInvalidator = tokenInvalidator;
  this.appId = appId;
  this.sharedPreferences = sharedPreferences;
  this.notificationAnalytics = notificationAnalytics;
  this.navigationTracker = navigationTracker;
  this.readPostsPersistence = readPostsPersistence;
}
项目:aptoide-client-v8    文件:AddStoreDialog.java   
@Override public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  tokenInvalidator =
      ((AptoideApplication) getContext().getApplicationContext()).getTokenInvalidator();
  converterFactory = WebService.getDefaultConverter();
  accountManager =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountManager();
  httpClient = ((AptoideApplication) getContext().getApplicationContext()).getDefaultClient();
  storeCredentialsProvider = new StoreCredentialsProviderImpl(AccessorFactory.getAccessorFor(
      ((AptoideApplication) getContext().getApplicationContext()
          .getApplicationContext()).getDatabase(), Store.class));
  baseBodyBodyInterceptor =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountSettingsBodyInterceptorPoolV7();

  if (savedInstanceState != null) {
    storeName = savedInstanceState.getString(BundleArgs.STORE_NAME.name());
  }
  storeAnalytics =
      new StoreAnalytics(AppEventsLogger.newLogger(getContext().getApplicationContext()),
          Analytics.getInstance());
}
项目:aptoide-client-v8    文件:MyStoresSubscribedFragment.java   
@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();
}
项目:aptoide-client-v8    文件:StoreTabWidgetsGridRecyclerFragment.java   
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  final StoreCredentialsProvider storeCredentialsProvider = new StoreCredentialsProviderImpl(
      AccessorFactory.getAccessorFor(((AptoideApplication) getContext().getApplicationContext()
          .getApplicationContext()).getDatabase(), Store.class));
  final OkHttpClient httpClient =
      ((AptoideApplication) getContext().getApplicationContext()).getDefaultClient();
  accountManager =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountManager();
  final BodyInterceptor<BaseBody> bodyInterceptor =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountSettingsBodyInterceptorPoolV7();
  final TokenInvalidator tokenInvalidator =
      ((AptoideApplication) getContext().getApplicationContext()).getTokenInvalidator();
  storeUtilsProxy = new StoreUtilsProxy(accountManager, bodyInterceptor, storeCredentialsProvider,
      AccessorFactory.getAccessorFor(((AptoideApplication) getContext().getApplicationContext()
          .getApplicationContext()).getDatabase(), Store.class), httpClient,
      WebService.getDefaultConverter(), tokenInvalidator,
      ((AptoideApplication) getContext().getApplicationContext()).getDefaultSharedPreferences());
  installedRepository =
      RepositoryFactory.getInstalledRepository(getContext().getApplicationContext());
  storeAnalytics =
      new StoreAnalytics(AppEventsLogger.newLogger(getContext().getApplicationContext()),
          Analytics.getInstance());
}
项目:Unofficial-Ups    文件:AnalyticsManager.java   
public static void setup(Application application){

        //Setup Fabric
        Fabric.with(application, new Crashlytics());

        //Setup amplitude
        Amplitude.getInstance().initialize(application, BuildConfig.AMPLITUDE_SDK).enableForegroundTracking(application);

        //Setup Facebook
        FacebookSdk.sdkInitialize(application);
        AppEventsLogger.activateApp(application);
    }
项目:kognitivo    文件:ShareInternalUtility.java   
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);
}
项目:kognitivo    文件:LoginMethodHandler.java   
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);
}
项目:kognitivo    文件:DialogPresenter.java   
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);
}
项目:kognitivo    文件:BoltsMeasurementEventListener.java   
@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);
}
项目:MADBike    文件:MADBikeApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    sInstance = this;
    FacebookSdk.sdkInitialize(getApplicationContext());
    AppEventsLogger.activateApp(this);
    OneSignal.startInit(this).setNotificationOpenedHandler(new MADBikeNotificationOpenedHandler(this)).init();
    Branch.getAutoInstance(this);
    Dexter.initialize(this);
}
项目:Odyssey2017    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    generator();
    FacebookSdk.sdkInitialize(getApplicationContext());
    callbackManager = CallbackManager.Factory.create();
    AppEventsLogger.activateApp(this);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_main);
    LogSaver.appendLog(TAG);
    logoiv = (ImageView) findViewById(R.id.imageView);
    TextView tv2016= (TextView) findViewById(R.id.l2016);
    Typeface typeface1=Typeface.createFromAsset(getAssets(),"canaro_extra_bold.otf");
    tv2016.setTypeface(typeface1);
    Typeface typeface=Typeface.createFromAsset(getAssets(),"canaro_extra_bold.otf");
    ShimmerTextView textView = (ShimmerTextView) findViewById(R.id.shimmertv);
    KenBurnsView kenBurnsView= (KenBurnsView) findViewById(R.id.kbview);
    kenBurnsView.animate().setDuration(500).start();
    if (textView != null) {
        textView.setTypeface(typeface);
    }
    Shimmer shimmer = new Shimmer();
    shimmer.start(textView);
    nextActivity();

}
项目:Stalker    文件:PeopleListActivity.java   
public void facebookGraphRequest() {
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp(getApplication());
    }
    GraphRequest request = GraphRequest.newMeRequest(
            //loginResult.getAccessToken(),
            AccessToken.getCurrentAccessToken(),
            new GraphRequest.GraphJSONObjectCallback() {
                @Override
                public void onCompleted(JSONObject object, GraphResponse response) {
                    Log.v(TAG, response.toString());

                    // Application code
                    try {
                        if (object == null) return;
                        Person person = new Person();
                        String name = object.getString("name");
                        String gender = object.getString("gender"); // 01/31/1980 format
                        String id = object.getString("id");
                        Log.d(TAG, "Name: " + name + ". Gender: " + gender);
                        person.setName(name);
                        person.setId(id);
                        person.setLink("http://www.facebook.com/" + id);

                        dataKey = mPlaceReference.push().getKey();
                        mPlaceReference.child(dataKey).setValue(person);


                    } catch (JSONException e) {
                        e.printStackTrace();

                    }
                }
            });
    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,email,gender,birthday");
    request.setParameters(parameters);
    request.executeAsync();
}
项目:Stalker    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    FacebookSdk.sdkInitialize(getApplicationContext());
    AppEventsLogger.activateApp(getApplication());

    setContentView(R.layout.activity_main);

    fragmentManager = getFragmentManager();
    initAwarenessClient();
    requestLocationPermission();
}
项目:GDFacebook    文件:FacebookSDK.java   
public void init (String p_appID) {
    APP_ID = p_appID;

    FacebookSdk.sdkInitialize(activity);
    FacebookSdk.setApplicationId(APP_ID);

    initCallbacks();

    AppEventsLogger.activateApp(activity);
    Utils.callScriptFunc("initialized", "true");
    Utils.d("Facebook:Initialized");

    onStart();
}
项目:firebase-chat-android-architecture-components    文件:ChatApp.java   
@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    }
    AppInjector.init(this);

    FacebookSdk.sdkInitialize(getApplicationContext());
    AppEventsLogger.activateApp(this);
}
项目:aptoide-client-v8    文件:HomeFragment.java   
@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);
}
项目:SjekkUT    文件:Analytics.java   
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);
    }
}
项目:analytics-with-rfx    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    FacebookSdk.sdkInitialize(getApplicationContext());
    callbackManager = CallbackManager.Factory.create();
    AppEventsLogger.activateApp(this);


    setContentView(R.layout.activity_main);

    info = (TextView)findViewById(R.id.info);
    loginButton = (LoginButton)findViewById(R.id.login_button);
    loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            info.setText(
                    "User ID: "
                            + loginResult.getAccessToken().getUserId()
                            + "\n" +
                            "Auth Token: "
                            + loginResult.getAccessToken().getToken()
            );
        }

        @Override
        public void onCancel() {

        }

        @Override
        public void onError(FacebookException e) {

        }
    });

    count = (TextView) findViewById(R.id.count);
    sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
}
项目:openshop.io-android    文件:AnalyticsUnitTest.java   
@Test
public void prepareTrackersAndFbLoggerTest() throws Exception {
    prepareMockedFields();

    // Tested method invocation
    Analytics.prepareTrackersAndFbLogger(testShop, mockContext);

    // Verify results
    verifyStatic(times(1));
    GoogleAnalytics.getInstance(mockContext);
    verifyStatic(never());
    Analytics.deleteAppTrackers();

    verify(mockAnalytics, times(1)).newTracker(testShop.getGoogleUa());
    verify(mockAnalytics, times(1)).newTracker(R.xml.global_tracker);

    verify(mockTrackerApp, times(1)).enableAutoActivityTracking(true);
    verify(mockTrackerApp, times(1)).enableExceptionReporting(false);
    verify(mockTrackerApp, times(1)).enableAdvertisingIdCollection(true);
    verifyNoMoreInteractions(mockTrackerApp);

    verify(mockTracker, times(1)).enableAutoActivityTracking(true);
    verify(mockTracker, times(1)).enableExceptionReporting(true);
    verify(mockTracker, times(1)).enableAdvertisingIdCollection(true);
    verifyNoMoreInteractions(mockTracker);

    HashMap<String, Tracker> trackersField = Whitebox.getInternalState(Analytics.class, "mTrackers");
    assertEquals(trackersField.size(), 2);
    AppEventsLogger appEventsLoggerField = Whitebox.getInternalState(Analytics.class, "facebookLogger");
    assertNotEquals(appEventsLoggerField, null);
}
项目:Stayfit    文件:LoginActivity.java   
@Override
protected void onResume() {
    super.onResume();

    // Logs 'install' and 'app activate' App Events.
    AppEventsLogger.activateApp(this);
}
项目:Stayfit    文件:LoginActivity.java   
@Override
protected void onPause() {
    super.onPause();

    // Logs 'app deactivate' App Event.
    AppEventsLogger.deactivateApp(this);
}
项目:survey-android    文件:SurveyApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    FacebookSdk.sdkInitialize(getApplicationContext());
    AppEventsLogger.activateApp(this);
}
项目:spicio    文件:SeasonEpisodesActivity.java   
@Override
protected void onResume() {
    super.onResume();
    mPresenter.loadEpisodes();

    // Logs 'install' and 'app activate' App Events.
    AppEventsLogger.activateApp(this);
}
项目:aptoide-client-v8    文件:MyAccountFragment.java   
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);

  list = (RecyclerView) view.findViewById(R.id.fragment_my_account_notification_list);
  list.setAdapter(adapter);
  list.setLayoutManager(new LinearLayoutManager(getContext()));

  logoutButton = (Button) view.findViewById(R.id.button_logout);
  logoutButton.setAllCaps(true);

  usernameTextView = (TextView) view.findViewById(R.id.my_account_username);
  storeNameTextView = (TextView) view.findViewById(R.id.my_account_store_name);
  userLayout = view.findViewById(R.id.my_account_user);
  userProfileEditButton = (Button) view.findViewById(R.id.my_account_edit_user_profile);
  userStoreEditButton = (Button) view.findViewById(R.id.my_account_edit_user_store);
  storeLayout = (RelativeLayout) view.findViewById(R.id.my_account_store);
  userAvatar = (ImageView) view.findViewById(R.id.my_account_user_avatar);
  storeAvatar = (ImageView) view.findViewById(R.id.my_account_store_avatar);
  separator = view.findViewById(R.id.my_account_separator);
  header = (RelativeLayout) view.findViewById(R.id.my_account_notifications_header);
  headerText = (TextView) view.findViewById(R.id.my_account_notifications_header)
      .findViewById(R.id.title);
  headerText.setText(getString(R.string.myaccount_header_title));

  moreNotificationsButton = (Button) view.findViewById(R.id.my_account_notifications_header)
      .findViewById(R.id.more);

  AptoideApplication application = (AptoideApplication) getContext().getApplicationContext();
  attachPresenter(new MyAccountPresenter(this, accountManager, crashReport,
      ((ActivityResultNavigator) getContext()).getMyAccountNavigator(),
      application.getNotificationCenter(), application.getDefaultSharedPreferences(),
      application.getNavigationTracker(), application.getNotificationAnalytics(),
      new PageViewsAnalytics(AppEventsLogger.newLogger(getContext().getApplicationContext()),
          Analytics.getInstance(), navigationTracker)));
}
项目:spicio    文件:MainActivity.java   
@Override
protected void onResume() {
    super.onResume();

    // Logs 'install' and 'app activate' App Events.
    AppEventsLogger.activateApp(this);
}