Recommendation API

Nuance Messaging SDK enables targetting by providing a rules engine within the SDK.

Recommendation API works in conjunction With Data Collection API, Data Collection startSession API should have invoked by the Application prior to requesting recommendation from the SDK.

Public methods

Following methods are exposed from NuanMessaging class.

RecommendationListener
RecommendationListener.onRecommendation is fired upon successfull matching of a rule condition.


	 NuanMessaging.getInstance().setRecommendationListener(new RecommendationListener() {
            @Override
            public void onRecommendation(RecommendationResponse response) {
                System.out.println("recommendation:"+response);
            }
        });


	Button b2 = (Button) findViewById(R.id.button2);
	b2.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			HashMap event = new HashMap();
			event.put("pageMarker","sale");
			NuanMessaging.getInstance().getRecommendation("onAnyEvent",event);
		}
	});