使用PushBots为Android推送通知通知、PushBots、Android

2023-09-04 03:34:01 作者:蝴蝶为花碎花却随风飞

我想使用pushbot为Android推送通知。它工作正常,如果应用程序运行时。但是,例如,如果应用程序没有运行,推送通知到达时,它会启动应用程序,然后崩溃了。任何建议对这个问题的原因是什么?

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?

推荐答案

确认

您已经复制PushBots.jar文件到你的Andr​​oid项目的库文件夹。 扩展应用程序类,并在其onCreate方法初始化PushBots,检查步骤6,7的的点击此处 查看详细信息

下面是一个示例code:

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, "","");
}
}