Skip to content

Instantly share code, notes, and snippets.

@stephenlaughton
Last active June 15, 2017 18:55
Show Gist options
  • Save stephenlaughton/8bc8d27347738a1e4cea664f6555c646 to your computer and use it in GitHub Desktop.
Save stephenlaughton/8bc8d27347738a1e4cea664f6555c646 to your computer and use it in GitHub Desktop.
Kochava Android integration at Invoice Simple
public class App extends Application {
private static KochavaHandler handler;
@Override
public void onCreate() {
handler = new KochavaHandler();
Feature.setAttributionHandler(handler);
HashMap<String, Object> datamap = new HashMap<String, Object>();
datamap.put(Feature.INPUTITEMS.KOCHAVA_APP_ID ,"koinvoice-simple-sm2" );
datamap.put(Feature.INPUTITEMS.REQUEST_ATTRIBUTION, true);
kTracker = new Feature( this.getApplicationContext() , datamap);
}
}
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.kochava.android.tracker.Feature;
public class KochavaHandler extends Handler {
private static final String TAG = "KochavaHandler";
@Override
public void handleMessage(Message msg)
{
String attributionDataString = msg.getData().getString(Feature.ATTRIBUTION_DATA);
Log.d(TAG, attributionDataString);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment