Skip to content

Instantly share code, notes, and snippets.

@codeInBit
Created February 9, 2017 08:08
Show Gist options
  • Save codeInBit/ba10eea977620c1acb832aac59cde209 to your computer and use it in GitHub Desktop.
Save codeInBit/ba10eea977620c1acb832aac59cde209 to your computer and use it in GitHub Desktop.
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
//call the asynctask class here to initialize the library;
new PushItInitialize().execute();
}
private class PushItInitialize extends AsyncTask<Void,Void,Boolean>{
@Override
protected Boolean doInBackground(Void... arg0){
PushIt pushIt = new PushIt(App.this,"YOUR API KEY FROM THE PUSH IT DEVELOPER CONSOLE");
pushIt.setNotificationIcon(R.drawable.notification_icon);//set an icon else use PUSH IT default icon
//set the class to launch on click of notification, (full qualified name)
//for instance, "ng.com.cellcore.mmsdirectsample.MainActivity"
pushIt.setLaunchClass("FULL_PACKAGE_NAME_OF_CLASS_TO_LAUNCH");
pushIt.init();//start listening for messages.
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment