我成功地将 pushwoosh 集成到我的 android 应用程序中。我正在使用 GCM。这是我的代码:
oncreate:
PushManager pushManager = new PushManager(this,
App_id, Sender_id);
pushManager.onStartup(savedInstanceState, this);
checkMessage(getIntent());
@Override
protected void onNewIntent(Intent intent)
{
super.onNewIntent(intent);
setIntent(intent);
checkMessage(intent);
setIntent(new Intent());
}
private void checkMessage(Intent intent)
{
if (null != intent)
{
if (intent.hasExtra(PushManager.PUSH_RECEIVE_EVENT))
{
showMessage("push message is " + intent.getExtras().getString(PushManager.PUSH_RECEIVE_EVENT));
}
else if (intent.hasExtra(PushManager.REGISTER_EVENT))
{
showMessage("register");
}
else if (intent.hasExtra(PushManager.UNREGISTER_EVENT))
{
showMessage("unregister");
}
else if (intent.hasExtra(PushManager.REGISTER_ERROR_EVENT))
{
showMessage("register error");
}
else if (intent.hasExtra(PushManager.UNREGISTER_ERROR_EVENT))
{
showMessage("unregister error");
}
}
}
private void showMessage(String message)
{
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
但是当我运行我的应用程序时,它显示注册错误。我找不到问题所在?在 logcat 中它显示消息注册错误:帐户丢失。请帮助