【问题标题】:Receive push notification from Pushwoosh on Android when app in background当应用程序在后台时,在 Android 上接收来自 Pushwoosh 的推送通知
【发布时间】:2015-10-16 08:25:24
【问题描述】:
我正在使用 android 上的最后一个 Pushwoosh SDK 来接收通知。
在活动中我有:
PushFragment.init(this);
和活动实现 PushEventListener
当应用程序处于前台时,一切正常。但是当它在后台时,它会收到通知,当我点击它时,应用程序会打开,但我需要从中读取一些数据。
我尝试了在 Pushwoosh“Native Android SDK”实现中完成的方式并且它可以工作,但是在“Android SDK Fragments”中,正如他们在他们的文档广播中描述的那样,在后台接收接收通知没有被调用。
【问题讨论】:
标签:
android
push-notification
pushwoosh
【解决方案1】:
您还需要处理 onNewIntent 函数的推送。当您点击通知并启动您的应用程序时会发生这种情况。
例如:
@Override
public void onNewIntent(Intent intent)
{
super.onNewIntent(intent);
//Check if we've got new intent with a push notification
PushFragment.onNewIntent(this, intent);
}