Page 1 of 1

Messages count

Posted: Thu May 16, 2019 1:14 pm
by anka
Hi, I'd like to know if there is a way, in v2.x to get messages count (from long text).
I saw similar topic in previous version, but I'd like to count it based on text and encoding only, because I need this information in different service than this one with my SMPP client. Is this possible?

Re: Messages count

Posted: Thu May 23, 2019 4:38 pm
by alt
Hello anka,

You can do this with SMS builder classes:

Code: Select all

  EncodingMapper mapper = EncodingMapper.Default;
  
  int count = SMS.ForSubmit()
                    .From("short_code")
                    .To("phone")
                    .Coding(DataCodings.UCS2)
                    .Text("long text here")
                    .Create(mapper)
                    .Length;