com.segment.analytics.Analytics.screen()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中com.segment.analytics.Analytics.screen()方法的一些代码示例,展示了Analytics.screen()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analytics.screen()方法的具体详情如下:
包路径:com.segment.analytics.Analytics
类名称:Analytics
方法名:screen

Analytics.screen介绍

暂无

代码示例

代码示例来源:origin: segmentio/analytics-android

/** @see #screen(String, String, Properties, Options) */
public void screen(@Nullable String name) {
 screen(null, name, null, null);
}

代码示例来源:origin: segmentio/analytics-android

/**
 * @see #screen(String, String, Properties, Options)
 * @deprecated Use {@link #screen(String)} instead.
 */
public void screen(@Nullable String category, @Nullable String name) {
 screen(category, name, null, null);
}

代码示例来源:origin: segmentio/analytics-android

/** @see #screen(String, String, Properties, Options) */
public void screen(@Nullable String name, @Nullable Properties properties) {
 screen(null, name, properties, null);
}

代码示例来源:origin: segmentio/analytics-android

/**
 * @see #screen(String, String, Properties, Options)
 * @deprecated Use {@link #screen(String, Properties)} instead.
 */
public void screen(
  @Nullable String category, @Nullable String name, @Nullable Properties properties) {
 screen(category, name, properties, null);
}

代码示例来源:origin: segmentio/analytics-android

@Private
void recordScreenViews(Activity activity) {
 PackageManager packageManager = activity.getPackageManager();
 try {
  ActivityInfo info =
    packageManager.getActivityInfo(activity.getComponentName(), PackageManager.GET_META_DATA);
  CharSequence activityLabel = info.loadLabel(packageManager);
  //noinspection deprecation
  screen(null, activityLabel.toString());
 } catch (PackageManager.NameNotFoundException e) {
  throw new AssertionError("Activity Not Found: " + e.toString());
 }
}

代码示例来源:origin: f2prateek/device-frame-generator

@Override protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 inflateView(R.layout.activity_main);
 setSupportActionBar(toolbar);
 pagerAdapter = new DeviceFragmentPagerAdapter(getFragmentManager(), deviceProvider.asList());
 pager.setAdapter(pagerAdapter);
 pager.setCurrentItem(pagerAdapter.getDeviceIndex(deviceProvider.getDefaultDevice()));
 tabLayout.setupWithViewPager(pager);
 analytics.screen(null, "Main");
}

代码示例来源:origin: segmentio/analytics-android

@Test
public void invalidScreen() throws Exception {
 try {
  analytics.screen(null, (String) null);
  fail("null category and name should throw exception");
 } catch (IllegalArgumentException expected) {
  assertThat(expected).hasMessage("either category or name must be provided.");
 }
 try {
  analytics.screen("", "");
  fail("empty category and name should throw exception");
 } catch (IllegalArgumentException expected) {
  assertThat(expected).hasMessage("either category or name must be provided.");
 }
}

代码示例来源:origin: segmentio/analytics-android

@Test
public void screen() {
 final String uuid = UUID.randomUUID().toString();
 analytics.screen("Home", new Properties().putValue("id", uuid));
 analytics.flush();
 assertMessageReceivedByWebhook(uuid);
}

代码示例来源:origin: segmentio/analytics-android

@Test
public void middlewareCanProceed() throws Exception {
 final AtomicReference<ScreenPayload> payloadRef = new AtomicReference<>();
 Analytics analytics =
   builder
     .middleware(
       new Middleware() {
        @Override
        public void intercept(Chain chain) {
         chain.proceed(chain.payload());
        }
       })
     .middleware(
       new Middleware() {
        @Override
        public void intercept(Chain chain) {
         BasePayload payload = chain.payload();
         payloadRef.set((ScreenPayload) payload);
         chain.proceed(payload);
        }
       })
     .build();
 analytics.screen("foo");
 assertThat(payloadRef.get().name()).isEqualTo("foo");
}

代码示例来源:origin: segmentio/analytics-android

@Test
public void screen() {
 analytics.screen("android", "saw tests", new Properties().putUrl("github.com"));
 verify(integration)
   .screen(
     argThat(
       new NoDescriptionMatcher<ScreenPayload>() {
        @Override
        protected boolean matchesSafely(ScreenPayload payload) {
         return payload.name().equals("saw tests")
           && //
           payload.category().equals("android")
           && //
           payload.properties().url().equals("github.com");
        }
       }));
}

代码示例来源:origin: segmentio/analytics-android

WearScreenPayload wearScreenPayload = wearPayload.payload(WearScreenPayload.class);
getAnalytics()
  .screen(
    wearScreenPayload.getName(),
    wearScreenPayload.getCategory(),

代码示例来源:origin: segmentio/analytics-android

@Test
public void optionsDisableIntegrations() {
 analytics.screen("foo", "bar", null, new Options().setIntegration("test", false));
 analytics.track("foo", null, new Options().setIntegration("test", false));
 analytics.group("foo", null, new Options().setIntegration("test", false));
 analytics.identify("foo", null, new Options().setIntegration("test", false));
 analytics.alias("foo", new Options().setIntegration("test", false));
 analytics.screen(
   "foo", "bar", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
 analytics.track("foo", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
 analytics.group("foo", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
 analytics.identify(
   "foo", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
 analytics.alias("foo", new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
 verifyNoMoreInteractions(integration);
}

相关文章