Created
February 9, 2017 08:08
-
-
Save codeInBit/ba10eea977620c1acb832aac59cde209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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