使用OneSignal推送通知两次接收通知

时间:2019-01-27 19:51:40

标签: android push-notification onesignal

我刚刚实现了OneSignal SDK,但工作正常,但是我开始收到重复的通知,在我的代码中,我改写了NotificationReceivedHandler以使其成为静默模式,但是过了一会儿,我再次收到了相同的消息

public class NotificationExtenderBare extends NotificationExtenderService {
@Override
protected boolean onNotificationProcessing(OSNotificationReceivedResult receivedResult) {
    OverrideSettings overrideSettings = new OverrideSettings();

    JSONObject obj = receivedResult.payload.toJSONObject();
    try {
        String body = obj.getString("body");
        String title = obj.getString("title");
        Log.d("body",body);
    } catch (JSONException e) {
        e.printStackTrace();
    }

    return true;
    }
}

0 个答案:

没有答案