Using PushBots for android push notification

。_饼干妹妹 提交于 2019-12-02 08:08:32

问题


I am trying to use pushbot for android push notification. it works fine if when the application is running. But for instance if the application is not running and a push notification arrives, it starts the app and then crashes it. Any suggestion to the cause of this problem?


回答1:


Make sure

  1. you've copied PushBots.jar file into libraries folder of your android project.
  2. Extended the Application Class, and initialized PushBots in its onCreate method, check out steps 6,7 click here for more details

Here's a sample code:

import com.pushbots.push.Pushbots;
import android.app.Application;


public class MyApplication extends Application {
@Override public void onCreate() {
super.onCreate();
Pushbots.init(this, "","");
}
}


来源:https://stackoverflow.com/questions/18853064/using-pushbots-for-android-push-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!