本文整理匯總了Java中com.facebook.appevents.AppEventsLogger類的典型用法代碼示例。如果您正苦於以下問題:Java AppEventsLogger類的具體用法?Java AppEventsLogger怎麽用?Java AppEventsLogger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AppEventsLogger類屬於com.facebook.appevents包,在下文中一共展示了AppEventsLogger類的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
}
}
示例2: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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"));
}
示例3: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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);
}
示例4: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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);
}
示例5: onActivityResumed
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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;
}
}
示例6: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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();
}
示例7: setInstalled
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
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");
}
示例8: getInstallManager
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
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;
}
示例9: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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());
}
示例10: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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);
}
示例11: 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());
}
示例12: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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);
}
示例13: onViewCreated
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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()));
}
示例14: onCreate
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
@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);
}
示例15: TimelineAnalytics
import com.facebook.appevents.AppEventsLogger; //導入依賴的package包/類
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;
}