To make use of the functionalities that the Messanging SDK offers, utilize the Messaging class.

To obtain the instance of this class:

protected void onCreate(Bundle savedInstanceState) {
Messaging messaging=Messaging.getInstance(this);
//get Instance of Messaging.. 

All the services offered by this library are provided by means of an instance of the Messaging class, and it can be obtained that it was indicated later.

Obtain User Data

Method to obtain each User by Device that is registered from the service.

Whenforsecallservice=true, search device parameters through the service.

protected void onResume() {
Messaging.fetchUser(getApplicationContext(), true);

you can use in the activity:


For asing property to the user, example of a Property: Juan, Alvarado, or 555-55-55, and example of key : example name, LastName or Phone.

then for update User data, you can use:;;

This method usesLocalBroadcastReceiver to send Instance from the SDK to Activity. (Please refer to Step 1).

Obtain Device

Receive the OS version of the user’s device, example:

    protected void onStart() {
                new IntentFilter(Messaging.ACTION_FETCH_DEVICE));
    protected void onResume() {
    private BroadcastReceiver mReceiver=new BroadcastReceiver() {
        public void onReceive(Context context, Intent intent) {
            boolean hasError=intent.getBooleanExtra(Messaging.INTENT_EXTRA_HAS_ERROR,true);
            if (!hasError ) {
                Serializable data=intent.getSerializableExtra(Messaging.INTENT_EXTRA_DATA);
                if(intent.getAction().equals(Messaging.ACTION_FETCH_DEVICE)&& data!=null){
                    messagingDevice = (MessagingDevice) data; //you can cast this for get information
                }else if(intent.getAction().equals(Messaging.ACTION_FETCH_USER)&& data!=null){
                    messagingUser =(MessagingUser) data;
                Toast.makeText(getApplicationContext(),"An error occurred on action "
   //you can see all the implementation in example app
    protected void onDestroy() {

MessagingDevice is used to handle Device parameters in the SDK.

To obtain this device instance, the SDK can provide it in three ways:

  • local memory

  • internal memory

  • service

To add a Tag to a Device, you may Save and it will immediately be updated in the database.


This method usesBroadcastReceiver to send Instance from the SDK to Activity. (Please refer to Step 1).;
Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.