@Override public void onRetry() { sendToDevice(eventType, contentMap, callback); } }));
/** * Send an event to a specific list of devices * * @param eventType the type of event to send * @param contentMap content to send. Map from user_id to device_id to content dictionary. * @param callback the asynchronous callback. */ public void sendToDevice(final String eventType, final MXUsersDevicesMap<Map<String, Object>> contentMap, final ApiCallback<Void> callback) { sendToDevice(eventType, contentMap, (new Random()).nextInt(Integer.MAX_VALUE) + "", callback); }
/** * Send a RoomKeyRequest to a list of recipients * * @param message the message * @param recipients the recipients. * @param transactionId the transaction id * @param callback the asynchronous callback. */ private void sendMessageToDevices(final Map<String, Object> message, List<Map<String, String>> recipients, String transactionId, final ApiCallback<Void> callback) { MXUsersDevicesMap<Map<String, Object>> contentMap = new MXUsersDevicesMap<>(); for (Map<String, String> recipient : recipients) { contentMap.setObject(message, recipient.get("userId"), recipient.get("deviceId")); } mSession.getCryptoRestClient().sendToDevice(Event.EVENT_TYPE_ROOM_KEY_REQUEST, contentMap, transactionId, callback); } }