This document explains how to add the Appoxee code to your application code
Source code integration
1. In the Application class of your android project, add following code
Code Block | ||||
---|---|---|---|---|
| ||||
@Override
public void onCreate() {
super.onCreate();
...
AppoxeeOptions opt = new AppoxeeOptions();
opt.sdkKey = SDK_KEY;
opt.googleProjectId = GOOGLE_PROJECT_ID;
Appoxee.engage(this, opt);
...
} |
pass your SDK Key and google project Id, SDK key is present in your Appoxee Application dashboard.
2. For receiving push events like, push received, open, dismissed you need to create on receiver, which extends PushDataReceiver
Code Block | ||||
---|---|---|---|---|
| ||||
public class MyPushBroadcastReceiver extends PushDataReceiver {
@Override
public void onPushReceived(PushData pushData) {
Log.d("APX", "Push received " + pushData);
}
@Override
public void onPushOpened(PushData pushData) {
Log.d("APX", "Push opened " + pushData);
}
@Override
public void onPushDismissed(PushData pushData) {
Log.d("APX", "Push dismissed " + pushData);
}
} |