我想延迟Onesignal推送通知(Android)

时间:2018-11-13 06:46:47

标签: notifications delay onesignal

这是我的代码,我想在15分钟后发送通知。我无法理解如何使用“ delivery_time_of_day”或“ send_after”功能。谁能帮我吗?

  OneSignal.startInit(this)
                .inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
                .unsubscribeWhenNotificationsAreDisabled(true)
                .init();

        OneSignal.idsAvailable(new OneSignal.IdsAvailableHandler() {
            @Override
            public void idsAvailable(String userId, String registrationId) {
                try {
                    OneSignal.postNotification(new JSONObject("{'contents': {'en':'Falın yorumlandı hemen okumak ister misin?'}, 'include_player_ids': ['" + userId + "']}"), null);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
        });

0 个答案:

没有答案