簡體   English   中英

應用引擎iOS推送通知異常:“指定的隊列未知”

[英]app-engine iOS push notification exception: “The specified queue is unknown”

我正在使用Google Sample項目在我的應用引擎后端上設置推送通知。 以下方法引發異常

private static void enqueuePushAlertToDevices(String alertMessage, String devicesAsJson) {
    Queue notificationQueue = QueueFactory.getQueue("notification-delivery");
    notificationQueue.add(TaskOptions.Builder.withMethod(TaskOptions.Method.PULL)
        .param("alert", alertMessage)
        .param("devices", devicesAsJson));
}

唯一的例外是

com.google.api.server.spi.SystemService invokeServiceMethod: The specified queue is unknown : notification-delivery
java.lang.IllegalStateException: The specified queue is unknown : notification-delivery
    at com.google.appengine.api.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:104)
    at com.google.appengine.api.taskqueue.QueueImpl$2.wrap(QueueImpl.java:552)
    at com.google.appengine.api.taskqueue.QueueImpl$2.wrap(QueueImpl.java:521)
    at com.google.appengine.api.utils.FutureWrapper.wrapAndCache(FutureWrapper.java:55)
    at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:92)
    at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
    at com.google.appengine.api.taskqueue.QueueApiHelper.getInternal(QueueApiHelper.java:72)
    at com.google.appengine.api.taskqueue.QueueImpl.add(QueueImpl.java:413)
....

鑒於該項目已經展開,我想很多開發人員都在使用它。 那么我應該在哪里定義隊列"notification-delivery" 我了解問題所在:我正在使用尚未定義的隊列。 但是我不清楚我應該在哪里定義它。 我還沒有在示例代碼中找到答案。 謝謝。

您看起來不夠努力:)。 其實不是很明顯。 只需將示例中的queue.xml復制到您的項目中即可。 樣本中的路徑是

/Downloads/solutions-ios-push-notification-sample-backend-java-master/war/WEB-INF

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM