How Leanplum SDKs work

Technical information on resource syncing with Leanplum SDKs

Resource syncing

  • On app launch, by default content from Leanplum is synced asynchronously. This means that events are tracked and users can still use the app while content is being synced. Note that only content that you have changed through Leanplum since the last session will be synced.
  • We recommend that in the case your initial screen on app launch depends on specific contents being synced, you should show a splash screen while content is being synced. You can then remove the splash screen once the SDK confirms that content syncing has finished. For more information please refer to the Callbacks section of our developer documentation.
  • If you do not implement the callback, then the application would use last session contents until they have been synced.
  • We require that the application has default content set up in the SDK. For example if a user downloads app and opens for the 1st time while being offline, they will be able to get the default variables. Note that in such a situation, no in app messages will be shown on the first session, this is because in app messages needs to be synced before shown.
  • Just about every variable type can be synced, to get the complete list, visit this URL and search for the string “define_”
  • https://www.leanplum.com/dashboard/static/iosdocs/html/index.html
  • Here is the list of variables types.
  • ARRAY
  • ARRAY_WITH_OBJECTS
  • BOOL
  • CGFLOAT
  • CHAR
  • COLOR
  • DICTIONARY
  • DICTIONARY_WITH_OBJECTS_AND_KEYS
  • DOUBLE
  • FILE
  • FLOAT
  • INT
  • INTEGER
  • LONG
  • LONG_LONG
  • NUMBER
  • SHORT
  • STRING
  • UCHAR
  • UINT
  • UINTEGER
  • ULONG
  • ULONGLONG
  • UNSIGNED_CHAR
  • UNSIGNED_INT
  • UNSIGNED_INTEGER
  • UNSIGNED_LONG
  • UNSIGNED_LONG_LONG
  • UNSIGNED_SHORT
  • USHORT
  • Automatic resource syncing ( can be on or off. Off by default)
  • Opens app in dev key and pull over.
  • Look for any static files and port them over (usually more files for ios and android)
  • Can choose what files types to sync in the SDK

SDK and in app messages:

  • All in-app messages are open sourced and native which allows our customers to use their custom branding and UI in their in-app messages. It will be able to look like just another screen in their app. Customers also have the ability to create their own in-app message templates.
  • In-app messages are synced to device at session start, this means that no internet connection is needed mid session when the message is being displayed.
  • For example if we wanted to show an in app message after a user who is in the US makes a purchase. The target would be all users who are in the US and the trigger of the in app message is the purchase event. Upon app launch, users who are in the US would qualify for the in app message and thus download the in app message. When the user triggers the purchase event mid session, the in app message is already stored in the application and is shown immediately.

Sending and receiving data through the SDK:

  • The Leanplum SDK is extremely battery and network efficient.
  • Messages are queued and sent every 15 minutes or when the app goes to the background / killed
  • While the device is offline, the SDK will check for an active connection every 15 minutes so that it can empty the queue and send messages to Leanplum. If there is still no connection, the SDK will continue adding messages to the queue.
  • Simply integrating the Leanplum SDK and calling Leanplum start, you will have access to these out of the box features.
  • Targeting (for example: app version, life cycle and location),
  • Analytics (for example: DAU, retention and engagement metrics)
  • Messaging (for example: in app messages and scheduled messages )
  • Upon app launch, the SDK will return the user’s experiment and variant ids if the device is online in the response object.