In order to identify users with a known attribute such as an email, phone, username and etc., the plugin provides an action method called “identify”. This method should be invoked after user logs in. During identify method call, the user id will be associated with the session(dg_user_id).

Method

identify: function(userId, successCallback, errorCallback) 

Parameters

userId	        - A string containing the user identifier
successCallback	- Call back method in which the plugin returns the Success messages
errorCallback	  - Call back method in which the plugin returns the Error messages

Example

cordova.plugins.datagran.identify(userId, loginSuccess, failure);