import {Component, OnInit} from '@angular/core';
// import {MessagingService} from '../../classes/firebaseMessaging.service';
import {User, UsersService} from '../../classes/resorcess/users.service';
// import { MessageService} from '../../components/message/ListMessages/message.service';
import {AuthService} from '../../classes/servicess/auth.service';

@Component({
  selector: 'app-notification',
  templateUrl: './notification.component.html'
})
export class NotificationComponent implements OnInit {
  // message faghat baray notification hast
  include: ['messages']

  message;
  today: number = Date.now();
  user: User;
  /**
   * incluse attribute hay ye relationship ro neshon mide
   */
  userMessages;

  constructor(
    // private msg: MessagingService,
              private authService: AuthService,
              // private messageService: MessageService,
              private userService: UsersService,
  ) {
    // this.messageService.register();
    this.userService.register();

     /* this.authService.currentUser.subscribe(user => {
          if (user)
          {
              this.user = user;
              this.userMessages = user.messages;
          }
      });*/



  }

  ngOnInit() {
    // todo
    // this.msg.getFireBasePermission();
    // this.msg.receiveFcmMessage();
    // this.message = this.msg.currentMessage;
  }
}
