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

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

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

Analytics.alias介绍

暂无

代码示例

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

/** @see #alias(String, Options) */
public void alias(@NonNull String newId) {
 alias(newId, null);
}

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

@Test
public void invalidAlias() {
 try {
  analytics.alias(null);
  fail("null new id should throw error");
 } catch (IllegalArgumentException expected) {
  assertThat(expected).hasMessage("newId must not be null or empty.");
 }
}

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

@Test
public void alias() {
 String anonymousId = traits.anonymousId();
 analytics.alias("foo");
 ArgumentCaptor<AliasPayload> payloadArgumentCaptor =
   ArgumentCaptor.forClass(AliasPayload.class);
 verify(integration).alias(payloadArgumentCaptor.capture());
 assertThat(payloadArgumentCaptor.getValue())
   .containsEntry("previousId", anonymousId)
   .containsEntry("userId", "foo");
}

代码示例来源: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);
}

相关文章