本文整理汇总了Java中com.github.messenger4j.send.Recipient类的典型用法代码示例。如果您正苦于以下问题:Java Recipient类的具体用法?Java Recipient怎么用?Java Recipient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Recipient类属于com.github.messenger4j.send包,在下文中一共展示了Recipient类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendTextMessage
import com.github.messenger4j.send.Recipient; //导入依赖的package包/类
private void sendTextMessage(String recipientId, String text) {
try {
final Recipient recipient = Recipient.newBuilder().recipientId(recipientId).build();
final NotificationType notificationType = NotificationType.REGULAR;
sendClient.sendTextMessage(recipient, notificationType, text);
} catch (MessengerApiException | MessengerIOException e) {
handleSendException(e);
}
}
示例2: sendTextMessage
import com.github.messenger4j.send.Recipient; //导入依赖的package包/类
private void sendTextMessage(String recipientId, String text) {
text = text.substring(0, Math.min(text.length(), 300));
try {
final Recipient recipient = Recipient.newBuilder().recipientId(recipientId).build();
final NotificationType notificationType = NotificationType.REGULAR;
final String metadata = "DEVELOPER_DEFINED_METADATA";
this.sendClient.sendTextMessage(recipient, notificationType, text, metadata);
} catch (MessengerApiException | MessengerIOException e) {
handleSendException(e);
}
}
示例3: sendTextMessage
import com.github.messenger4j.send.Recipient; //导入依赖的package包/类
private void sendTextMessage(String recipientId, String text) {
try {
final Recipient recipient = Recipient.newBuilder().recipientId(recipientId).build();
final NotificationType notificationType = NotificationType.REGULAR;
final String metadata = "DEVELOPER_DEFINED_METADATA";
this.sendClient.sendTextMessage(recipient, notificationType, text, metadata);
} catch (MessengerApiException | MessengerIOException e) {
handleSendException(e);
}
}
开发者ID:messenger4j,项目名称:messenger4j-spring-boot-quickstart-template,代码行数:12,代码来源:MessengerPlatformCallbackHandler.java