Android push notification not received



Discussions regarding 1C:Enterprise for mobile devices with Android, iOS, or Windows Phone.

#1
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 29, 2016
Company: DND Yazılım

Hi,

I working on push notification. My code is:

Mobile;

//managed application module

Code
Procedure OnStart()
   UpdateClientID();
   
   AttachIdleHandler("Connectable_UpdateFollowingID", 7200);
   #If MobileAppClient Then
      DeliverableNotifications.AttachNotificationHandler("Plugin_ProcessingNotifications");
   #EndIf   
EndProcedure

Procedure Connectable_UpdateFollowingID() Export
   UpdateClientID();
EndProcedure

Procedure UpdateClientID()
   #If MobileAppClient Then
      mProjectNumber = CommonCallServer.GetProjectNumber();
      If IsBlankString(mProjectNumber) Then
         Return;      
      EndIf; 
      
      Try
         SubscriberID = DeliverableNotifications.ReceiveNotificationSubscriberID(mProjectNumber);
      Except
         Message(ErrorDescription());
         Return;
      EndTry;
      
      mQueryOptions = New Structure("ServerAddress, NameBase, ClientID");
      // указываем IP Сервера, он может быть как локальный, так и нет
      mQueryOptions.ServerAddress = "192.168.0.14";
      // имя базы, под которым она была опубликована на вэб сервере
      // о том, как выполнить публикацию информации в Интернете информации предостаточно
      mQueryOptions.NameBase      = "GELAL";
      mQueryOptions.ClientID = SubscriberID;
      
      CommonCallServer.SendIDToServer(mQueryOptions);
   #EndIf
EndProcedure

Procedure Plugin_ProcessingNotifications(Notification, IsLocal, IsShow) Export
   // просто сообщим тест пуша
   Message(Notification.Text);
   #If MobileAppClient Then
      MultimediaTools.PlaySoundAlert(SoundAlert.Default,True);
      Noti = New DeliverableNotification;
      Noti.Title   = Notification.Text;
      Noti.Text   = Notification.Text;
      Noti.SoundAlert = SoundAlert.Default;
      DeliverableNotifications.AddLocalNotification(Noti);
   #EndIf
EndProcedure


It is working. my mobile device get id from firebase and update server constant is clientID.

Than, i was try send a deliverablenotification on server to mobile device.

Server;

Code
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
   ThisForm.ServerKey = "AAAA5L5rYdQ:APA91bEY0GG6FZB2GCW3OwnUhBtAREB65pghyZvc9UKJC64IyOenBJFTDYVqwVBw7T2POQg-E_Vd37eALjkKqb9gKWlPlxCOtO2BQa82DXEnDJSR-qnonyFiC8aLXTCx4rAmTrkjpLdA";
   ThisForm.Başlık = "AA";
   ThisForm.Mesaj = "AAA";
EndProcedure

&AtClient
Function DeSerialize(Data, ConversionType = Undefined)
   XMLReader = New XMLReader;
   XMLReader.SetString(Data);
   mReadXML = XDTOSerializer.ReadXML(XMLReader, ConversionType);
   XMLReader.Close();
   Return mReadXML;
EndFunction

&AtServerNoContext
Function GetClientID()
   Return Constants.ClientID.Get().Get();
EndFunction
 
&AtClient
Procedure Gönder(Command)
   Notification      = New DeliverableNotification;
    Notification.Title   = Başlık;
   Notification.Text   = Mesaj;
   Notification.SoundAlert = SoundAlert.Default;
   pXML = DeSerialize(GetClientID());
   Notification.Recipients.Add(pXML);
   DeliverableNotificationSend.Send(Notification, ServerKey);
EndProcedure

&AtClient
Procedure OnOpen(Cancel)
   ThisForm.ClientID = DeSerialize(GetClientID()).DeviceID;
EndProcedure



This code is working. Not give error. But notification not received my mobile device.

My versions are:
Mobile device: Android 5.1
Mobile App: 8.3.12.67

Server: 8.3.12.1567

How can i fix this issue? Please help me.

 
#2
People who like this:0Yes/0No
Administrator
Rating: 17
Joined: Dec 4, 2017
Company:

Dear Hüseyin Çağrı Bayraktar,

To be able to find out why your code works not as you expect it to do, we need to get a configuration to try the code at.

Could you please send as a sample configuration (.*dt) for that purpose?

Best regards,
Vladimir Gurov

1C Company support team
 
#3
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 29, 2016
Company: DND Yazılım

Dear Vladimir,

Can you send your email address?

 
#4
People who like this:0Yes/0No
Administrator
Rating: 17
Joined: Dec 4, 2017
Company:

int@1c.ru

1C Company support team
 
#5
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 29, 2016
Company: DND Yazılım

I will send now.

 
#6
People who like this:0Yes/0No
Administrator
Rating: 17
Joined: Dec 4, 2017
Company:

Dear Hüseyin Çağrı Bayraktar,

We are still investigating the samples you sent us.

Meanwhile we recommend you to add the 5th parameter to the call to the DeliverableNotificationSend.Send() method in your code.

The parameter (DeliverableNotificationSendIssuesInformation) is to get information from 1C:Enterprise platform about issues that occurred when sending notifications via the call.

<<
<DeliverableNotificationSendIssuesInformation> (optional)

Type: Array.
Contains the details of deliverable notification sending issues. It is an array of elements of DeliverableNotificationSendingIssueInformation type.
>>

Best regards,
Vladimir Gurov

1C Company support team
 
Subscribe