本文整理汇总了Java中com.crashlytics.android.answers.SignUpEvent类的典型用法代码示例。如果您正苦于以下问题:Java SignUpEvent类的具体用法?Java SignUpEvent怎么用?Java SignUpEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SignUpEvent类属于com.crashlytics.android.answers包,在下文中一共展示了SignUpEvent类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: eventLogin
import com.crashlytics.android.answers.SignUpEvent; //导入依赖的package包/类
public static void eventLogin(Context context,boolean success){
//Fabric
Answers.getInstance().logSignUp(new SignUpEvent()
.putMethod("Normal")
.putSuccess(success));
//Firebase
Bundle params = new Bundle();
params.putBoolean("Success",success);
FirebaseAnalytics.getInstance(context).logEvent(AnalyticsConstants.EVENT_LOGIN,params);
//Amplitude
try {
Amplitude.getInstance().logEvent(AnalyticsConstants.EVENT_LOGIN,new JSONObject().put("Success",success));
} catch (JSONException e) {
Crashlytics.logException(e);
}
}
示例2: sendUserProperties
import com.crashlytics.android.answers.SignUpEvent; //导入依赖的package包/类
@Override
public void sendUserProperties(String name, String value) {
switch (name) {
case AnalyticConstant.USER_EMAIL:
Crashlytics.setUserEmail(value);
break;
case AnalyticConstant.USER_NAME:
Crashlytics.setUserName(value);
break;
case AnalyticConstant.USER_SIGN_IN:
Answers.getInstance().logLogin(new LoginEvent().putMethod(value).putSuccess(true));
break;
case AnalyticConstant.USER_SIGN_UP:
Answers.getInstance().logSignUp(new SignUpEvent().putMethod(value).putSuccess(true));
break;
default:
Answers.getInstance().logCustom(new CustomEvent("Custom_Event").putCustomAttribute(name, value));
break;
}
}
示例3: test_buildAnswersSignUpEvent
import com.crashlytics.android.answers.SignUpEvent; //导入依赖的package包/类
@Test
public void test_buildAnswersSignUpEvent()
{
SignUpEvent result = logger.buildAnswersSignUpEvent(signupEvent);
Map<String, Object> predefinedAttributes = PackageScopeWrappedCalls.getPredefinedAttributes(result);
assertThat(predefinedAttributes.size()).isEqualTo(2);
assertThat(predefinedAttributes).containsKey(Attributes.SignUp.METHOD);
assertThat(predefinedAttributes).containsKey(Attributes.SignUp.SUCCESS);
Map<String, Object> customAttributes = PackageScopeWrappedCalls.getCustomAttributes(result);
assertThat(customAttributes.size()).isEqualTo(1);
assertThat(customAttributes).containsKey(CUSTOM_KEY);
}
示例4: logSpecificEvent
import com.crashlytics.android.answers.SignUpEvent; //导入依赖的package包/类
@Override
public void logSpecificEvent(@NonNull AnalyticsEvent event)
{
SignUpEvent SignUpEvent = buildAnswersSignUpEvent(event);
answers.logSignUp(SignUpEvent);
}
示例5: sendSignUp
import com.crashlytics.android.answers.SignUpEvent; //导入依赖的package包/类
public void sendSignUp(final JSONArray data, final CallbackContext context) {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
SignUpEvent evt = new SignUpEvent();
Answers.getInstance()
.logSignUp(evt);
}
});
}
示例6: logSignUp
import com.crashlytics.android.answers.SignUpEvent; //导入依赖的package包/类
public static void logSignUp(String method) {
if (!BuildConfig.DEBUG && sEnabled)
Answers.getInstance().logSignUp(new SignUpEvent()
.putMethod(method)
.putSuccess(true));
}