public class AVPush extends Object
| 构造器和说明 |
|---|
AVPush()
Creates a new push notification.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearExpiration()
Clears both expiration values, indicating that the notification should never expire.
|
Set<String> |
getChannelSet() |
long |
getExpirationTime() |
long |
getExpirationTimeInterval() |
AVObject |
getNotification()
返回推送后创建的_Notification对象。
|
Map<String,Object> |
getPushData() |
Date |
getPushDate() |
AVQuery<? extends AVInstallation> |
getPushQuery() |
Set<String> |
getPushTarget() |
void |
send()
Sends this push notification while blocking this thread until the push notification has
successfully reached the AVOSCloud servers.
|
static io.reactivex.Observable<com.alibaba.fastjson.JSONObject> |
sendDataInBackground(com.alibaba.fastjson.JSONObject data,
AVQuery<? extends AVInstallation> query)
A helper method to concisely send a push to a query.
|
static void |
sendDataInBackground(com.alibaba.fastjson.JSONObject data,
AVQuery<? extends AVInstallation> query,
SendCallback callback)
A helper method to concisely send a push to a query.
|
io.reactivex.Observable<com.alibaba.fastjson.JSONObject> |
sendInBackground()
Sends this push notification in a background thread.
|
void |
sendInBackground(SendCallback callback)
Sends this push notification in a background thread.
|
static io.reactivex.Observable<com.alibaba.fastjson.JSONObject> |
sendMessageInBackground(String message,
AVQuery<? extends AVInstallation> query)
A helper method to concisely send a push message to a query.
|
static void |
sendMessageInBackground(String message,
AVQuery<? extends AVInstallation> query,
SendCallback callback)
A helper method to concisely send a push message to a query.
|
void |
setChannel(String channel)
Sets the channel on which this push notification will be sent.
|
void |
setChannels(Collection<String> channels)
Sets the collection of channels on which this push notification will be sent.
|
void |
setCloudQuery(String cql)
可以通过 cql来针对push进行筛选
请注意cql 的主体应该是_Installation表
请在设置cql的同时,不要设置pushTarget(ios,android,wp)
|
void |
setData(com.alibaba.fastjson.JSONObject data)
Sets the entire data of the push message.
|
void |
setData(Map<String,Object> data)
Sets the entire data of the push message.
|
void |
setExpirationTime(long time)
Sets a UNIX epoch timestamp at which this notification should expire, in seconds (UTC).
|
void |
setExpirationTimeInterval(long timeInterval)
Sets the time interval after which this notification should expire, in seconds.
|
void |
setMessage(String message)
Sets the message that will be shown in the notification.
|
void |
setPushDate(Date date)
Set the push date at which the push will be sent.
|
void |
setPushToAndroid(boolean pushToAndroid) |
void |
setPushToIOS(boolean pushToIOS) |
void |
setPushToWindowsPhone(boolean pushToWP) |
void |
setQuery(AVQuery<? extends AVInstallation> query)
Sets the query for this push for which this push notification will be sent.
|
public AVPush()
public AVObject getNotification()
public AVQuery<? extends AVInstallation> getPushQuery()
public Date getPushDate()
public long getExpirationTime()
public long getExpirationTimeInterval()
public void setChannel(String channel)
public void setChannels(Collection<String> channels)
public void setData(Map<String,Object> data)
public void setData(com.alibaba.fastjson.JSONObject data)
public void setPushDate(Date date)
date - The push date.public void setExpirationTime(long time)
public void setExpirationTimeInterval(long timeInterval)
public void setMessage(String message)
public void setPushToAndroid(boolean pushToAndroid)
public void setPushToIOS(boolean pushToIOS)
public void setPushToWindowsPhone(boolean pushToWP)
public void setQuery(AVQuery<? extends AVInstallation> query)
query - A query to which this push should target. This must be a AVInstallation query.public void setCloudQuery(String cql)
cql - public void clearExpiration()
public void send()
public io.reactivex.Observable<com.alibaba.fastjson.JSONObject> sendInBackground()
public void sendInBackground(SendCallback callback)
callback - callback.done(e) is called when the send completes.public static void sendDataInBackground(com.alibaba.fastjson.JSONObject data,
AVQuery<? extends AVInstallation> query,
SendCallback callback)
AVPush push = new AVPush(); push.setData(data); push.setQuery(query); push.sendInBackground(callback);
data - The entire data of the push message. See the push guide for more details on the
data format.query - A AVInstallation query which specifies the recipients of a push.callback - callback.done(e) is called when the send completes.public static io.reactivex.Observable<com.alibaba.fastjson.JSONObject> sendDataInBackground(com.alibaba.fastjson.JSONObject data,
AVQuery<? extends AVInstallation> query)
AVPush push = new AVPush(); push.setData(data); push.setQuery(query); push.sendInBackground(callback);
data - The entire data of the push message. See the push guide for more details on the
data format.query - A AVInstallation query which specifies the recipients of a push.public static io.reactivex.Observable<com.alibaba.fastjson.JSONObject> sendMessageInBackground(String message, AVQuery<? extends AVInstallation> query)
AVPush push = new AVPush(); push.setMessage(message); push.setQuery(query); push.sendInBackground();
message - The message that will be shown in the notification.query - A AVInstallation query which specifies the recipients of a push.public static void sendMessageInBackground(String message, AVQuery<? extends AVInstallation> query, SendCallback callback)
AVPush push = new AVPush(); push.setMessage(message); push.setQuery(query); push.sendInBackground(callback);
message - The message that will be shown in the notification.query - A AVInstallation query which specifies the recipients of a push.callback - callback.done(e) is called when the send completes.Copyright © 2019. All rights reserved.