处理自定义视图的pushwoosh

时间:2016-05-22 13:13:14

标签: android push-notification google-cloud-messaging pushwoosh

我正在使用pushwoosh库,我有自己的BroadcastReceiver来处理推送通知。

我已经更新了pushwoosh库,现在我得到了两次我的通知,它们甚至看起来都不一样。

原因是我正在处理我的班级推送,并且pushwoose也会在那里处理通知:

public class GCMListenerService extends GcmListenerService {     private static final String TAG = GCMListenerService.class.getName();

public GCMListenerService() {
}

public void onMessageReceived(String from, Bundle data) {
    Log.info(TAG, "Received message: " + (data != null?data.toString():"<null>") + " from: " + from);

    try {
        PushServiceHelper.generateNotification(this.getApplicationContext(), data);
    } catch (Exception var4) {
        Log.exception(var4);
    }

}

}

如何防止pushwoosh处理通知?

1 个答案:

答案 0 :(得分:0)

尝试使用工厂(扩展AbsNotificationFactory)而不是自定义BroadcastReceiver。

就像在这里的指南:
http://docs.pushwoosh.com/docs/android-faq#customizing-push-notifications