Handling Beacon and Experience Responses

Callback Methods

There are two callbacks you can define on the FootmarksAPI class instance. They should be used after getting an instance from the init() call. You register for them by calling:

mFootmarksAPI.onRangeBeacons(beaconList -> {     
// Description: Returns all beacons currently in range of the user.    
// Your processing code goes here        
})

and

mFootmarksAPI.onCompleteExperiences((beacon, experienceList) -> {    
//Description: Returns one or more Experience objects, depending on how your
//experiences/beacons/zones are setup in the management console.   
// Your processing code goes here        
});

Casting Experience Objects

Java

switch(exp.getType()){
case ExperienceTypeImage:
	ImageExp image = ((ImageExp)exp);
	ProgressBar progress(ProgressBar)findViewById(R.id.progress);
	image.presentPictureInImageView((ImageView)
	row.findViewById(R.id.image), progress); 
	break;
	
case ExperienceTypeVideo:
	VideoExp video = ((VideoExp)exp);
	String url = video.videoUrl;
	break;
	
case ExperienceTypeHtml:
	HtmlExp html = ((HtmlExp)exp);
	html.presentHtmlInWebView(((WebView)findViewById(R.id.webview)));
	break;
	
case ExperienceTypeUrl:
	UrlExp url = ((UrlExp)exp);
	url.presentUrlInWebView(((WebView)findViewById(R.id.webview)));
	break;
	
case ExperienceTypeCustom:
	CustomExp custom = ((CustomExp)exp);
	String item = custom.text;
	break;
	
case ExperienceTypeAlert:
	AlertExp alert = ((AlertExp)exp);
	alert.showAlert();
	break;
	
default:
	break;
	
}