{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Cordova SDK -  Plugin Methods","type":"basic","slug":"cordova-plugin-methods","excerpt":"","body":"The list of all methods can be found below.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"/**\\n* Sets the Authorization Data for the app. Authorization Data is later used in API Requests. GCM_APP_ID is required for Android Apps.\\n*/\\nwindow.Pulsate.setAuthorizationData(String APP_ID, String APP_KEY, String GCM_APP_ID);\\n\\n/**\\n* Sets the Authorization Data for the app. Authorization Data is later used in API Requests. PUSH_ENABLED, LOCATION_ENABLED, IS_PULSATE_APP_DELEGATE, IS_PULSATE_NOTIFICATION_DELEGATE by defualt are true. Setting any of these to false will require Developers to add handle all the callback manually.\\n*/\\nwindow.Pulsate.setAuthorizationDataCustom(String APP_ID, String APP_KEY, boolean PUSH_ENABLED, boolean LOCATION_ENABLED, boolean IS_PULSATE_APP_DELEGATE, boolean IS_PULSATE_NOTIFICATION_DELEGATE);\\n\\n/**\\n* Starts Pulsate session lifecycle.\\n* Session starts when the app enters foreground and ends when it goes to background.\\n*/\\nwindow.Pulsate.startPulsateSession(function(success){}, function(error){});\\n\\n/** \\n* Starts Pulsate session lifecycle, for the given user.\\n* Session starts when the app enters foreground and ends when it goes to background.\\n*/\\nwindow.Pulsate.startPulsateSessionForAlias(String alias, function(success){}, function(error){});\\n\\n/**\\n* Logs out the currently logged in user.\\n* To login an user use startPulsateSessionForAlias(String alias).\\n*/\\nwindow.Pulsate.logout(function(success){}, function(error){});\\n\\n/**\\n* Updates the user's first name. Gets updated when entering background.\\n*/\\nwindow.Pulsate.updateFirstName(String firstName);\\n\\n/**\\n* Updates the user's last name. Gets updated when entering background.\\n*/\\nwindow.Pulsate.updateLastName(String lastName);\\n\\n/**\\n* Updates the user's email. Gets updated when entering background.\\n*/\\nwindow.Pulsate.updateEmail(String email);\\n\\n/**\\n* Updates user's age. Gets updated when entering background.\\n*/\\nwindow.Pulsate.updateAge(String age);\\n\\n/**\\n* Updates user's gender. Gets updated when entering background.\\n* Values:\\n* window.Pulsate.PULUserGenderMale\\n* window.Pulsate.PULUserGenderFemale\\n*/\\nwindow.Pulsate.updateGender(Gender gender);\\n\\n/**\\n* Enables / Disables receiving push notifications, by default enabled.\\n*/\\nwindow.Pulsate.setPushNotificationEnabled(boolean enabled);\\n\\n/**\\n* Updates user's privacy. Gets updated in realtime.\\n* Values:\\n* window.Pulsate.PULPrivacyLevelSubscribed\\n* window.Pulsate.PULPrivacyLevelUnsubscribed\\n*/\\nwindow.Pulsate.setPrivacy(Privacy privacy);\\n\\n/**\\n* Creates a custom attribute with a string. Neither can be nil. Gets updated when entering background.\\n*/\\nwindow.Pulsate.createAttributeString(String attributeName, String attributeValue);\\n\\n/**\\n* Creates a custom attribute with a int. Neither can be nil. Gets updated when entering background.\\n*/\\nwindow.Pulsate.createAttributeInt(String attributeName, int attributeValue);\\n\\n/**\\n* Creates a custom attribute with a float. Neither can be nil. Gets updated when entering background.\\n*/\\nwindow.Pulsate.createAttributeFloat(String attributeName, float attributeValue);\\n\\n/**\\n* Creates a custom attribute with a boolean. Neither can be nil. Gets updated when entering background.\\n*/\\nwindow.Pulsate.createAttributeBool(String attributeName, boolean attributeValue);\\n\\n/**\\n* Creates a custom attribute with a date. Neither can be nil. Gets updated when entering background.\\n*/\\nwindow.Pulsate.createAttributeDate(String attributeName, Date attributeValue);\\n\\n/**\\n* Increments given integer attribute by given value. Gets updated when entering background.\\n*/\\nwindow.Pulsate.incrementCounter(String counterName, int value);\\n\\n/**\\n* Decrements given integer attribute by given. Gets updated when entering background.\\n*/\\nwindow.Pulsate.decrementCounter(String counterName, int value);\\n\\n/**\\n* Opens the Pulsate Inbox\\n*/\\nwindow.Pulsate.showFeed ();\\n\\n/**\\n* Sends a custom in app event\\n*/\\nwindow.Pulsate.createEvent(String event);\\n\\n/**\\n* Sends a list of custom in app events\\n*/\\nwindow.Pulsate.createEvents(List<String> events);\\n\\n/**\\n* Attributes synchronize when the app is entering background. This method forces the synchronization to happen instantly.\\n*/\\nwindow.Pulsate.forceAttributeSync();\\n\\n/**\\n* Enables or Disables the New Thread Button in the Pulsate Inbox\\n*/\\nwindow.Pulsate.setNewThreadButtonEnabled(boolean enabled);\\n\\n/**\\n* Enables or Disables sending the user location when a beacon event happens.\\n* By default this it disabled\\n*/\\nwindow.Pulsate.sendLocationWithBeaconEvents(boolean enabled);\\n\\n/**\\n* Enables or Disables sending beacon and geofencing events.\\n* By default enabled\\n*/\\nwindow.Pulsate.setLocationUpdatesEnabled(boolean enabled);\\n\\n/**\\n* Enables or Disables showing in app notifications.\\n* By default enabled\\n*/\\nwindow.Pulsate.enableInAppNotification(boolean enabled);\\n\\n/**\\n* Sets the user to either be authorized or unauthorized to view the inbox.\\n*/\\nwindow.Pulsate.setUserAuthorized(boolean authorized);\\n\\n/**\\n* Shows the last blocked in app notification.\\n*/\\nwindow.Pulsate.showLastInAppNotification();\\n\\n/**\\n* Shows the last blocked inbox action - single card view, inbox entry, thread entry\\n*/\\nwindow.Pulsate.showLastUnauthorizedMessage();\\n\\n/**\\n* Android ONLY.\\n* Sets a listener that receives updates about unread count from Pulsate.\\n* The SDK updates the unread count on 3 events:\\n* 1. On leaving the Pulsate Inbox\\n* 2. On Pulsate Session Start\\n* 3. On getting a Push Notification\\n* Note - This method will always return 0 and will reset unread count if the Pulsate Web App is set to clear unread count on accessing the inbox.\\n*/\\nwindow.Pulsate.setUnreadCountUpdateListener(function(success){});\\n\\n/**\\n* iOS only callbacks for badge updates.\\n*/\\nwindow.Pulsate.onBadgeUpdated(function(result){});\\n\\nwindow.Pulsate.onBadgeDecrementBy(function(result){});\\n\\nwindow.Pulsate.onBadgeIncrementBy(function(result){});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5e4ffdbce004be001fdbfdf4","project":"54aa7f773b56130b0056c86e","version":{"version":"2.4","version_clean":"2.4.0","codename":"Cordova SDK","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e4feaa9bca78600237fcefc","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","5e4feaa9bca78600237fcefd","5e4feaa9bca78600237fcefe","5e4ffdbce004be001fdbfde7","5e4ffdbce004be001fdbfde8","5e4feaa9bca78600237fcf01","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","5e4ffdbce004be001fdbfde9","5e4feaa9bca78600237fcf03","5c73dd27e8fdc000572a206a","5e4ffdbce004be001fdbfdea","5e4ffdbce004be001fdbfdeb"],"_id":"5e4ffdbce004be001fdbfe02","project":"54aa7f773b56130b0056c86e","forked_from":"5e4ffc2c9cdd19004b878788","__v":0,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z"},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Cordova SDK","slug":"cordova-plugin","order":1,"from_sync":false,"reference":false,"_id":"5e4ffdbce004be001fdbfde9","version":"5e4ffdbce004be001fdbfe02","__v":0,"project":"54aa7f773b56130b0056c86e","createdAt":"2016-11-09T12:38:10.993Z"},"user":"57bc3654b9c7f0220009c77b","createdAt":"2018-07-18T09:19:30.605Z","githubsync":"","__v":0,"parentDoc":null}

Cordova SDK - Plugin Methods


The list of all methods can be found below. [block:code] { "codes": [ { "code": "/**\n* Sets the Authorization Data for the app. Authorization Data is later used in API Requests. GCM_APP_ID is required for Android Apps.\n*/\nwindow.Pulsate.setAuthorizationData(String APP_ID, String APP_KEY, String GCM_APP_ID);\n\n/**\n* Sets the Authorization Data for the app. Authorization Data is later used in API Requests. PUSH_ENABLED, LOCATION_ENABLED, IS_PULSATE_APP_DELEGATE, IS_PULSATE_NOTIFICATION_DELEGATE by defualt are true. Setting any of these to false will require Developers to add handle all the callback manually.\n*/\nwindow.Pulsate.setAuthorizationDataCustom(String APP_ID, String APP_KEY, boolean PUSH_ENABLED, boolean LOCATION_ENABLED, boolean IS_PULSATE_APP_DELEGATE, boolean IS_PULSATE_NOTIFICATION_DELEGATE);\n\n/**\n* Starts Pulsate session lifecycle.\n* Session starts when the app enters foreground and ends when it goes to background.\n*/\nwindow.Pulsate.startPulsateSession(function(success){}, function(error){});\n\n/** \n* Starts Pulsate session lifecycle, for the given user.\n* Session starts when the app enters foreground and ends when it goes to background.\n*/\nwindow.Pulsate.startPulsateSessionForAlias(String alias, function(success){}, function(error){});\n\n/**\n* Logs out the currently logged in user.\n* To login an user use startPulsateSessionForAlias(String alias).\n*/\nwindow.Pulsate.logout(function(success){}, function(error){});\n\n/**\n* Updates the user's first name. Gets updated when entering background.\n*/\nwindow.Pulsate.updateFirstName(String firstName);\n\n/**\n* Updates the user's last name. Gets updated when entering background.\n*/\nwindow.Pulsate.updateLastName(String lastName);\n\n/**\n* Updates the user's email. Gets updated when entering background.\n*/\nwindow.Pulsate.updateEmail(String email);\n\n/**\n* Updates user's age. Gets updated when entering background.\n*/\nwindow.Pulsate.updateAge(String age);\n\n/**\n* Updates user's gender. Gets updated when entering background.\n* Values:\n* window.Pulsate.PULUserGenderMale\n* window.Pulsate.PULUserGenderFemale\n*/\nwindow.Pulsate.updateGender(Gender gender);\n\n/**\n* Enables / Disables receiving push notifications, by default enabled.\n*/\nwindow.Pulsate.setPushNotificationEnabled(boolean enabled);\n\n/**\n* Updates user's privacy. Gets updated in realtime.\n* Values:\n* window.Pulsate.PULPrivacyLevelSubscribed\n* window.Pulsate.PULPrivacyLevelUnsubscribed\n*/\nwindow.Pulsate.setPrivacy(Privacy privacy);\n\n/**\n* Creates a custom attribute with a string. Neither can be nil. Gets updated when entering background.\n*/\nwindow.Pulsate.createAttributeString(String attributeName, String attributeValue);\n\n/**\n* Creates a custom attribute with a int. Neither can be nil. Gets updated when entering background.\n*/\nwindow.Pulsate.createAttributeInt(String attributeName, int attributeValue);\n\n/**\n* Creates a custom attribute with a float. Neither can be nil. Gets updated when entering background.\n*/\nwindow.Pulsate.createAttributeFloat(String attributeName, float attributeValue);\n\n/**\n* Creates a custom attribute with a boolean. Neither can be nil. Gets updated when entering background.\n*/\nwindow.Pulsate.createAttributeBool(String attributeName, boolean attributeValue);\n\n/**\n* Creates a custom attribute with a date. Neither can be nil. Gets updated when entering background.\n*/\nwindow.Pulsate.createAttributeDate(String attributeName, Date attributeValue);\n\n/**\n* Increments given integer attribute by given value. Gets updated when entering background.\n*/\nwindow.Pulsate.incrementCounter(String counterName, int value);\n\n/**\n* Decrements given integer attribute by given. Gets updated when entering background.\n*/\nwindow.Pulsate.decrementCounter(String counterName, int value);\n\n/**\n* Opens the Pulsate Inbox\n*/\nwindow.Pulsate.showFeed ();\n\n/**\n* Sends a custom in app event\n*/\nwindow.Pulsate.createEvent(String event);\n\n/**\n* Sends a list of custom in app events\n*/\nwindow.Pulsate.createEvents(List<String> events);\n\n/**\n* Attributes synchronize when the app is entering background. This method forces the synchronization to happen instantly.\n*/\nwindow.Pulsate.forceAttributeSync();\n\n/**\n* Enables or Disables the New Thread Button in the Pulsate Inbox\n*/\nwindow.Pulsate.setNewThreadButtonEnabled(boolean enabled);\n\n/**\n* Enables or Disables sending the user location when a beacon event happens.\n* By default this it disabled\n*/\nwindow.Pulsate.sendLocationWithBeaconEvents(boolean enabled);\n\n/**\n* Enables or Disables sending beacon and geofencing events.\n* By default enabled\n*/\nwindow.Pulsate.setLocationUpdatesEnabled(boolean enabled);\n\n/**\n* Enables or Disables showing in app notifications.\n* By default enabled\n*/\nwindow.Pulsate.enableInAppNotification(boolean enabled);\n\n/**\n* Sets the user to either be authorized or unauthorized to view the inbox.\n*/\nwindow.Pulsate.setUserAuthorized(boolean authorized);\n\n/**\n* Shows the last blocked in app notification.\n*/\nwindow.Pulsate.showLastInAppNotification();\n\n/**\n* Shows the last blocked inbox action - single card view, inbox entry, thread entry\n*/\nwindow.Pulsate.showLastUnauthorizedMessage();\n\n/**\n* Android ONLY.\n* Sets a listener that receives updates about unread count from Pulsate.\n* The SDK updates the unread count on 3 events:\n* 1. On leaving the Pulsate Inbox\n* 2. On Pulsate Session Start\n* 3. On getting a Push Notification\n* Note - This method will always return 0 and will reset unread count if the Pulsate Web App is set to clear unread count on accessing the inbox.\n*/\nwindow.Pulsate.setUnreadCountUpdateListener(function(success){});\n\n/**\n* iOS only callbacks for badge updates.\n*/\nwindow.Pulsate.onBadgeUpdated(function(result){});\n\nwindow.Pulsate.onBadgeDecrementBy(function(result){});\n\nwindow.Pulsate.onBadgeIncrementBy(function(result){});", "language": "javascript" } ] } [/block]