【发布时间】:2012-11-22 10:43:01
【问题描述】:
我正在使用城市飞艇发送推送通知,我在我的应用中完成了所有配置,我可以从城市飞艇网站发送通知。
现在我必须请求城市飞艇 api 来发送推送通知(使用这个“https://go.urbanairship.com/api/push/”)URL,我已经发送了这样的 json
{
"apids": [
"some APID",
"another APID"
],
"aliases": ["my_alias"],
"tags": ["tag1", "tag2"],
"android": {
"alert": "Hello from Urban Airship!",
"extra": {"a_key":"a_value"}
}
}
我想为单个设备发送推送通知,我必须使用 APID,不是吗?
什么是 APID?
编辑
这个 groovy 推送请求代码
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0' )
import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
def http = new HTTPBuilder('https://go.urbanairship.com')
http.request( POST ) {
uri.path = '/api/push/'
body = [android: 'alert: You have reply', apids: 'some apid']
requestContentType = ContentType.JSON
response.success = { resp ->
println "Success! ${resp.status}"
}
}
但它不起作用?
【问题讨论】:
-
define "i think this APID not working after some time" (define "not working", define "i think", define "some time". 另外,你的意思是“什么是请求格式”?不就是一个简单的帖子吗?
-
我想为单个设备发送推送通知,我必须使用 APID,不是吗?
标签: android sencha-touch push-notification urbanairship.com