/// <summary> /// Optional. Sets the socket server path for Development mode. /// Path is of the form hostName:port /// </summary> /// <param name="hostName"> The host name of the socket server. </param> /// <param name="port"> The port to connect to. </param> public override void SetSocketConnectionSettings(string hostName, int port) { NativeSDK.CallStatic("setSocketConnectionSettings", hostName, port); }
public override void SetGcmSenderId(string senderId) { NativeSDK.CallStatic("setGcmSenderId", senderId); }
/// <summary> /// Logs a particular event in your application. The string can be /// any value of your choosing, and will show up in the dashboard. /// To track purchases, use Leanplum.PURCHASE_EVENT_NAME as the event name. /// </summary> public override void Track(string eventName, double value, string info, IDictionary <string, object> parameters) { NativeSDK.CallStatic("track", eventName, value, info, Json.Serialize(parameters)); }
public override IDictionary <string, object> Vars() { string jsonString = NativeSDK.CallStatic <string>("vars"); return((Dictionary <string, object>)Json.Deserialize(jsonString)); }
/// <summary> /// Forces content to update from the server. If variables have changed, the /// appropriate callbacks will fire. Use sparingly as if the app is updated, /// you'll have to deal with potentially inconsistent state or user experience. /// </summary> public override void ForceContentUpdate() { NativeSDK.CallStatic("forceContentUpdate"); }
/// <summary> /// Updates the user ID and adds or modifies user attributes. /// </summary> /// <param name="newUserId">New user identifier.</param> /// <param name="value">User attributes.</param> public override void SetUserAttributes(string newUserId, IDictionary <string, object> value) { NativeSDK.CallStatic("setUserAttributes", newUserId, Json.Serialize(value)); }
/// <summary> /// Resumes the current state. /// </summary> public override void ResumeState() { NativeSDK.CallStatic("resumeState"); }
/// <summary> /// Get user id. /// </summary> public override string GetUserId() { return(NativeSDK.CallStatic <string>("getUserId")); }
/// <summary> /// This should be your first statement in a unit test. Setting this to true /// will prevent Leanplum from communicating with the server. /// </summary> public override void SetTestMode(bool testModeEnabled) { NativeSDK.CallStatic("setTestModeEnabled", testModeEnabled); }
/// <summary> /// Must call either this or SetAppIdForDevelopmentMode /// before issuing any calls to the API, including start. /// </summary> /// <param name="appId"> Your app ID. </param> /// <param name="accessKey"> Your production key. </param> public override void SetAppIdForProductionMode(string appId, string accessKey) { NativeSDK.CallStatic("setAppIdForProductionMode", appId, accessKey); }
/// <summary> /// Sets a custom device ID. Device IDs should be unique across physical devices. /// </summary> /// <param name="deviceId">Device identifier.</param> public override void SetDeviceId(string deviceId) { NativeSDK.CallStatic("setDeviceId", deviceId); }
/// <summary> /// Must call either this or SetAppIdForProductionMode /// before issuing any calls to the API, including start. /// </summary> /// <param name="appId"> Your app ID. </param> /// <param name="accessKey"> Your development key. </param> public override void SetAppIdForDevelopmentMode(string appId, string accessKey) { NativeSDK.CallStatic("setAppIdForDevelopmentMode", appId, accessKey); }
/// <summary> /// Sets the time interval between uploading events to server. /// Default is <see cref="EventsUploadInterval.AtMost15Minutes"/>. /// </summary> /// <param name="uploadInterval"> The time between uploads. </param> public override void SetEventsUploadInterval(EventsUploadInterval uploadInterval) { NativeSDK.CallStatic("setEventsUploadInterval", (int)uploadInterval); }
/// <summary> /// The default timeout is 10 seconds for requests, and 15 seconds for file downloads. /// </summary> /// <param name="seconds"> Timeout in seconds for standard webrequests. </param> /// <param name="downloadSeconds"> Timeout in seconds for downloads. </param> public override void SetNetworkTimeout(int seconds, int downloadSeconds) { NativeSDK.CallStatic("setNetworkTimeout", seconds, downloadSeconds); }
/// <summary> /// Logs a purchase event in your application. The string can be any /// value of your choosing, however in most cases you will want to use /// Leanplum.PURCHASE_EVENT_NAME /// </summary> public override void TrackPurchase(string eventName, double value, string currencyCode, IDictionary <string, object> parameters) { NativeSDK.CallStatic("trackPurchase", eventName, value, currencyCode, Json.Serialize(parameters)); }
/// <summary> /// Sets whether realtime updates to the client are enabled in development mode. /// This uses websockets which can have high CPU impact. Default: true. /// </summary> public override void SetRealtimeUpdatesInDevelopmentModeEnabled(bool enabled) { NativeSDK.CallStatic("setFileUploadingEnabledInDevelopmentMode", enabled); }
/// <summary> /// Advances to a particular state in your application. The string can be /// any value of your choosing, and will show up in the dashboard. /// A state is a section of your app that the user is currently in. /// </summary> public override void AdvanceTo(string state, string info, IDictionary <string, object> parameters) { NativeSDK.CallStatic("advanceTo", state, info, Json.Serialize(parameters)); }
/// <summary> /// Set location manually. Calls SetDeviceLocationWithLatitude with cell type. Best if /// used in after calling DisableLocationCollection. Not supported on Native. /// </summary> /// <param name="latitude"> Device location latitude. </param> /// <param name="longitude"> Device location longitude. </param> public override void SetDeviceLocation(double latitude, double longitude) { NativeSDK.CallStatic("setDeviceLocation", latitude, longitude); }
/// <summary> /// Pauses the current state. /// You can use this if your game has a "pause" mode. You shouldn't call it /// when someone switches out of your app because that's done automatically. /// </summary> public override void PauseState() { NativeSDK.CallStatic("pauseState"); }
/// <summary> /// Set location manually. Calls SetDeviceLocationWithLatitude with cell type. Best if /// used in after calling DisableLocationCollection. Not supported on Native. /// </summary> /// <param name="latitude"> Device location latitude. </param> /// <param name="longitude"> Device location longitude. </param> /// <param name="city"> Location city. </param> /// <param name="region"> Location region. </param> /// <param name="country"> Country ISO code. </param> /// <param name="type"> Location accuracy type. </param> public override void SetDeviceLocation(double latitude, double longitude, string city, string region, string country, LPLocationAccuracyType type) { NativeSDK.CallStatic("setDeviceLocation", latitude, longitude, (int)type); }
/// <summary> /// Returns variant ids. /// Recommended only for debugging purposes and advanced use cases. /// </summary> public override List <object> Variants() { string jsonString = NativeSDK.CallStatic <string>("variants"); return((List <object>)Json.Deserialize(jsonString)); }
/// <summary> /// Disables collecting location automatically. Will do nothing if Leanplum-Location is /// not used. Not supported on Native. /// </summary> public override void DisableLocationCollection() { NativeSDK.CallStatic("disableLocationCollection"); }
/// <summary> /// Returns metadata for all active in-app messages. /// Recommended only for debugging purposes and advanced use cases. /// </summary> public override Dictionary <string, object> MessageMetadata() { string jsonString = NativeSDK.CallStatic <string>("messageMetadata"); return((Dictionary <string, object>)Json.Deserialize(jsonString)); }
public override void SetPushDeliveryTrackingEnabled(bool enabled) { NativeSDK.CallStatic("setPushDeliveryTracking", enabled); }
public override bool TriggerActionForId(string actionId) { return(NativeSDK.CallStatic <bool>("triggerAction", actionId)); }
public override void SetMiPushApplication(string miAppId, string miAppKey) { NativeSDK.CallStatic("setMiPushApplication", miAppId, miAppKey); }
public override void SetGcmSenderIds(string[] senderIds) { NativeSDK.CallStatic("setGcmSenderIds", Json.Serialize(senderIds)); }
public override void SetLogLevel(Constants.LogLevel logLevel) { NativeSDK.CallStatic("setLogLevel", (int)logLevel); }
/// <summary> /// Sets the traffic source info for the current user. /// Keys in info must be one of: publisherId, publisherName, publisherSubPublisher, /// publisherSubSite, publisherSubCampaign, publisherSubAdGroup, publisherSubAd. /// </summary> public override void SetTrafficSourceInfo(IDictionary <string, string> info) { NativeSDK.CallStatic("setTrafficSourceInfo", Json.Serialize(info)); }
/// <summary> /// Optional. Sets the API server. /// The API path is of the form http[s]://hostname/servletName /// </summary> /// <param name="hostName"> The name of the API host, such as www.leanplum.com </param> /// <param name="servletName"> The name of the API servlet, such as api </param> /// <param name="useSSL"> Whether to use SSL </param> public override void SetApiConnectionSettings(string hostName, string servletName = "api", bool useSSL = true) { NativeSDK.CallStatic("setApiConnectionSettings", hostName, servletName, useSSL); }