"No Permission to send Notifications"?

 

Hello,

I am trying to send notifications to smartphone but the terminal on computer says:

"Error. The client terminal does not have permissions to send notifications." it is the print that the test expert gives back after it queries for TerminalInfoInteger(TERMINAL_NOTIFICATIONS_ENABLED). 



I think I have set all notifications "allow":

-InSmartphone "Settings/Apps/Metatrader5"

-In Metatrader5 Mobile  Settings Notifications On

-on mql5.com website Profile/Security I have put my MQID in the little box and it shows Samsung Phone and I enabled the little bell icon.

What else am I missing?

It is Sunday Afternoon so I am trying it on BTCUSD, because there are Ticks there.

I know in the documentation it says that the function can be withdrawn if you abuse it but I haven't used it for a year and even back then I tried it some times but I never had an issue.

Here is the code, it is derived from the example code script. It even has safeguarding against spamming, as in it allows to send notifications every ten seconds max:

long notificationLast = 0;
int notificationCnt=0;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---






//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

   if(long(TimeCurrent())-10 > notificationLast)
     {
      //--- check permission to send notifications in the terminal
      if(!TerminalInfoInteger(TERMINAL_NOTIFICATIONS_ENABLED))
        {
         Print("Error. The client terminal does not have permission to send notifications");
         return;
        }
      //--- send notification
      ResetLastError();
      if(!SendNotification("Test MEssage #"+string(notificationCnt)))
         {Print("SendNotification() failed. Error ",GetLastError());
         
         }
      else
     {
      Print("Sent Push Notification #"+string(notificationCnt)+" to phone");
      notificationLast = long(TimeCurrent());
      notificationCnt++;
     }
     }
  }
MetaTrader 5 mobile applications for iPhone/iPad and Android
MetaTrader 5 mobile applications for iPhone/iPad and Android
  • www.metatrader5.com
Mobile trading in MetaTrader 5 — Forex, stocks and futures can be traded anytime and anywhere. The installation of MetaTrader 5 for iOS or Android on your smartphone or tablet allows you to stay informed with financial information and conduct trade operations in financial markets 24 hours a day. The rich functionality of the MetaTrader 5...
 
void OnStart()
  {
   Print((bool)TerminalInfoInteger(TERMINAL_NOTIFICATIONS_ENABLED));
  }