Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.76 KB | None | 0 0
  1.     fun login(
  2.         provider: String?,
  3.         email: String?,
  4.         name: String?,
  5.         phone: String?
  6.     ) {
  7.         if (email != null) {
  8.             mixPanelAPI.identify(email)
  9.             mixPanelAPI.people.identify(email)
  10.         } else if (phone != null) {
  11.             mixPanelAPI.identify(phone)
  12.             mixPanelAPI.people.identify(phone)
  13.         }
  14.         val personProperties = JSONObject()
  15.         personProperties.put("\$email", email)
  16.         personProperties.put("\$name", name)
  17.         personProperties.put("\$phone", phone)
  18.         mixPanelAPI.people.set(personProperties)
  19.         mpProperties.put("provider", provider)
  20.         mixPanelAPI.track(EVENTS_TRACKING_LOGIN, mpProperties)
  21.  
  22.         clearPropertiesObjects()
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement