Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise. Mobile platform > TelephonyTools

Forum

Search UsersRules
TelephonyTools
#1
Active user
Points:: 0
Joined:: Mar 14, 2012

Help me, please!
I added some command line in "OnStart" procedure of Configuration:

Code
#If MobileAppClient Then
       TelephonyTools.AttachSMSMessageHandler(WriteSMS);
#EndIf
&AtMobileAppClient

Procedure WriteSMS(Command) Export
   // Ghi nội dung tin nhắn vào biểu ghi
   PhoneMessage = New SMSMessage;
   PhoneNumber = PhoneMessage.From; //Số điện thoại
   DateReceive = PhoneMessage.DateReceived; //Ngày nhận
   Content = PhoneMessage.Text;  //Nội dung tin nhắn
   Message(Content);
EndProcedure


But, when I write Configuration, 1C inform me that commands have an error:
{ManagedApplicationModule(37,47)}: unknown variable (WriteSMS)
      TelephonyTools.AttachSMSMessageHandler(<<?>>WriteSMS); (check: mobile client application)

I do not understand why?

Profile
#2
Active user
Points:: 0
Joined:: Nov 19, 2012

Ninh Giang Thi,

Code
TelephonyTools.AttachSMSMessageHandler("WriteSMS"); 


TelephonyTools.AttachSMSMessageHandler
Syntax:

AttachSMSMessageHandler(<ProcedureName>)
Parameters:

<ProcedureName> (required)

Type: String; NotifyDescription.
Name of the procedure enabled as a handler.
Description:

It enables the incoming SMS handle.
When an incoming SMS is received, a handler with the parameters specified below is called;
Message: SMSMessage,
Additional parameter (if used NotifyDescription).

Profile
#3
Active user
Points:: 0
Joined:: Mar 14, 2012

Aleksey Bochkov

Thanks for your help.

It runned, But I can read the SMS message in my Program. When a new message received, my program have no action. Can you give me a example or some command line instructions?
I want to write a program can read SMS on mobile device and write it's content to Information register.

Profile
#4
Active user
Points:: 0
Joined:: Nov 19, 2012

Ninh Giang Thi,

I guess you didn't check out Help information inside 1C at all ;).

Code
&AtClient
Procedure Attach(Command)
   
   #If MobileAppClient Then
      
      ND = New NotifyDescription("OnMessageReceived", ThisForm);
      
      TelephonyTools.AttachSMSMessageHandler(ND);
      
   #EndIf
   
EndProcedure

&AtClient
Procedure OnMessageReceived(SMSMessage, Params) Export
   
   Message(SMSMessage.Text);
   
EndProcedure

Profile
#5
Active user
Points:: 0
Joined:: Mar 14, 2012

Aleksey Bochkov,

I copied your code to my application, then I try to runed it. But I do not know why It is still not running.
(I leave it on "OnStart" procedure of Configuration). Otherwise, how can I read all SMS received before in my phone when application running?

May I have not egnough some important details in my app?

Profile
#6
Active user
Points:: 0
Joined:: Mar 14, 2012

Aleksey Bochkov,

Could you send me your example configuration that runned? I try to use your code in my configuration many time but it do not run.

Profile
#7
Active user
Points:: 0
Joined:: Nov 19, 2012

Ninh Giang Thi,
If you want to start it in OnStart - you should change it a bit. See the attachments.

Quote
Otherwise, how can I read all SMS received before in my phone when application running?

I think it is impossible. You can get only call log.
But you always can create small native application, run it from 1C and get whatever you want.
Check out "MobileDeviceApplicationLaunch" in Syntax assistant.

Profile
#8
Active user
Points:: 0
Joined:: Mar 14, 2012

Aleksey Bochkov,

I got your configuration, and then built it to my mobile.
But It did not run, my mobile use Android 4.2.2.
May I need some change in Configuration setup or change something in my mobile? Or it need special requirement?

Profile
#9
Active user
Points:: 0
Joined:: Nov 19, 2012

Ninh Giang Thi,
Sorry, I have no idea what is going on.

My phone - Galaxy S5, Android 4.4.2.
Mobile platform 8.3.5.96.
But I used developer mobile platform - configuration was loaded into platform as xml-file.
It is way much easier than building an apk each time.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.