我想知道如何在不让用户知道推送通知是received.Just的情况下推送通知,我的应用程序应该知道通知,并根据通知执行所需的任务。
发布于 2015-02-16 15:08:00
public class GCMIntentService extends GCMBaseIntentService
{
@Override
protected void onMessage(Context context, Intent intent)
{
Log.i(TAG, "Received message");
if (intent.getExtras().containsKey("payload"))
{
String message = intent.getExtras().getString("payload");
CommonUtilities.displayMessage(context, message);
// notifies user
//generateNotification(context, message);
}
}
}在这里,在这个方法中,当消息到来时不通知用户。
编辑:
仅当您在自己实现的应用程序中直接使用过GCM时,此答案才适用。如果你使用parse.com来做这件事,那么你就不能实现你所要求的。因为解析API会在内部通知此用户。
https://stackoverflow.com/questions/28535803
复制相似问题