use of chat.rocket.android.api.RaixPushHelper in project Rocket.Chat.Android by RocketChat.
the class GcmPushRegistrationObserver method registerGcmTokenForServer.
private Task<Void> registerGcmTokenForServer() throws IOException {
final String gcmToken = getGcmToken(getSenderId());
final RealmUser currentUser = realmHelper.executeTransactionForRead(realm -> RealmUser.queryCurrentUser(realm).findFirst());
final String userId = currentUser != null ? currentUser.getId() : null;
final String pushId = new RocketChatCache(context).getOrCreatePushId();
return new RaixPushHelper(realmHelper, ddpClientRef).pushUpdate(pushId, gcmToken, userId);
}
Aggregations