Andoird Bango not posting events

May 21, 2012 at 4:09 AM

Hey guys, I'm just starting to give the Bango SDK a go now. The docs are nice and easy to follow. I have Andoird and iOS Bango integrated, compiling and running on my devices.

I'm having issues getting the Android SDK to post and events to the server. I have an application ID set up and below is my code that is definitely run as I can see it in the log output.

I'm also definitely connected to the internet and I have all the permissions i need set in the manifest. I'm running out of ideas about how to get this to work.

public class UnityBangoActivity extends UnityPlayerActivity 
{
	Hashtable<String, String> customParameters = new Hashtable<String, String>();
	
	protected void onCreate(Bundle savedInstanceState) 
	{
	    // call UnityPlayerActivity.onCreate()
	    super.onCreate(savedInstanceState);
	
		customParameters.put("bgo_custom8", "blah");
		customParameters.put("bgo_custom9", "blah");
		customParameters.put("bgo_custom10", "blah");
	    
	    Log.d("UnityBangoActivity", "Setting up bango!");
	    
	    BangoAgent.setLogEnabled(true);
	    BangoAgent.setApplicationType("Freemium");
	    BangoAgent.setApplicationChannel("MMAnalytics");
	    BangoAgent.setContinueSessionSeconds(10);
	    BangoAgent.setFindLocation(false);
	    BangoAgent.setUseOfflineStorage(true);
	    BangoAgent.setPostURL("https://bango.net/appanalytics/debug/");
	    
	    String applicationKey = "##########"; // this is set properly in my real program
	    
	    BangoAgent.onStartSession( this.getBaseContext(), applicationKey, "", "", customParameters );
	    
	    Log.d("UnityBangoActivity", "TestEvent");
	    BangoAgent.onEvent("TestEvent", "TestValue", "TestDetail", customParameters );
		
	    Log.d("UnityBangoActivity", "Batch: " + BangoAgent.viewBatch());

	    Log.d("UnityBangoActivity", "postEvents");
	    BangoAgent.postEvents();
	    
	    Log.d("UnityBangoActivity", "Batch: " + BangoAgent.viewBatch());
	    
	    Log.d("UnityBangoActivity", "Bango Session Started!");
	}
	
	protected void onDestroy()
	{
		BangoAgent.onEndSession( this.getBaseContext(), "", "", customParameters );

		Log.d("UnityBangoActivity", "Bango Session Ended!");
		super.onDestroy();
	}
} 

 

Cheers in advance for any tips you may have,

Antony.

May 21, 2012 at 5:04 AM

Never mind it's working now. Not exactly sure why.