@Test public void testEventTypeParsing() { for (int i = 0; i < MParticle.EventType.values().length; i++) { assertEquals(i + "", MParticle.EventType.values()[i], jsInterfaceInstance.convertEventType(i)); } }
EventType convertEventType(int eventType) { switch (eventType) { case 0: return EventType.Unknown; case 1: return EventType.Navigation; case 2: return EventType.Location; case 3: return EventType.Search; case 4: return EventType.Transaction; case 5: return EventType.UserContent; case 6: return EventType.UserPreference; case 7: return EventType.Social; case 9: return EventType.Media; default: return EventType.Other; } }
MParticleJSInterface { EventType convertEventType(int eventType) { switch (eventType) { case 0: return EventType.Unknown; case 1: return EventType.Navigation; case 2: return EventType.Location; case 3: return EventType.Search; case 4: return EventType.Transaction; case 5: return EventType.UserContent; case 6: return EventType.UserPreference; case 7: return EventType.Social; case 9: return EventType.Media; default: return EventType.Other; } } }
MParticleJSInterface { EventType convertEventType(int eventType) { switch (eventType) { case 0: return EventType.Unknown; case 1: return EventType.Navigation; case 2: return EventType.Location; case 3: return EventType.Search; case 4: return EventType.Transaction; case 5: return EventType.UserContent; case 6: return EventType.UserPreference; case 7: return EventType.Social; case 9: return EventType.Media; default: return EventType.Other; } } MParticleJSInterface(); }
MParticleJSInterface { EventType convertEventType(int eventType) { switch (eventType) { case 0: return EventType.Unknown; case 1: return EventType.Navigation; case 2: return EventType.Location; case 3: return EventType.Search; case 4: return EventType.Transaction; case 5: return EventType.UserContent; case 6: return EventType.UserPreference; case 7: return EventType.Social; case 9: return EventType.Media; default: return EventType.Other; } } MParticleJSInterface(); @JavascriptInterface String getCurrentMpId(); @JavascriptInterface void login(); @JavascriptInterface void login(String json); @JavascriptInterface void logout(); @JavascriptInterface void logout(String json); @JavascriptInterface void modify(String json); @JavascriptInterface void logEvent(String json); @JavascriptInterface void setUserTag(String json); @JavascriptInterface void removeUserTag(String json); @JavascriptInterface void setUserAttribute(String json); @JavascriptInterface void removeUserAttribute(String json); @JavascriptInterface void setSessionAttribute(String json); @JavascriptInterface void setUserIdentity(String json); @JavascriptInterface void removeUserIdentity(String json); @JavascriptInterface void addToCart(String json); @JavascriptInterface void removeFromCart(String json); @JavascriptInterface void clearCart(); @JavascriptInterface void setUserAttributeList(String json); @JavascriptInterface void removeAllUserAttributes(); @JavascriptInterface String getUserAttributesLists(); @JavascriptInterface String getAllUserAttributes(); static void registerWebView(WebView webView, String workspaceToken); }
MParticleJSInterface { EventType convertEventType(int eventType) { switch (eventType) { case 0: return EventType.Unknown; case 1: return EventType.Navigation; case 2: return EventType.Location; case 3: return EventType.Search; case 4: return EventType.Transaction; case 5: return EventType.UserContent; case 6: return EventType.UserPreference; case 7: return EventType.Social; case 9: return EventType.Media; default: return EventType.Other; } } MParticleJSInterface(); @JavascriptInterface String getCurrentMpId(); @JavascriptInterface void login(); @JavascriptInterface void login(String json); @JavascriptInterface void logout(); @JavascriptInterface void logout(String json); @JavascriptInterface void modify(String json); @JavascriptInterface void logEvent(String json); @JavascriptInterface void setUserTag(String json); @JavascriptInterface void removeUserTag(String json); @JavascriptInterface void setUserAttribute(String json); @JavascriptInterface void removeUserAttribute(String json); @JavascriptInterface void setSessionAttribute(String json); @JavascriptInterface void setUserIdentity(String json); @JavascriptInterface void removeUserIdentity(String json); @JavascriptInterface void addToCart(String json); @JavascriptInterface void removeFromCart(String json); @JavascriptInterface void clearCart(); @JavascriptInterface void setUserAttributeList(String json); @JavascriptInterface void removeAllUserAttributes(); @JavascriptInterface String getUserAttributesLists(); @JavascriptInterface String getAllUserAttributes(); static void registerWebView(WebView webView, String workspaceToken); static final String INTERFACE_BASE_NAME; }