使用自定义视图处理 pushwoosh

handle pushwoosh with custom view

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

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

原因是我用我的 class 处理我的推送,而 pushwoose 也用那里处理通知 class :

public class GCMListenerService 扩展 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 处理通知?

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

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