The Expiry property gets or sets a duration as string value that
defines the the 'si-expires' attribute as per WAP-167 (WAP
Service Indication Specification) by Open Mobile Alliance (OMA). If the
recipients phone supports this feature then the WAP Push message will be
automatically deleted or marked as 'expired' after the expiry time.
The value for Expiry property is specified as follows:
"1H" to "24H" - 1 Hour to 24 Hours from time of sending
"1D" to "31D" - 1 Day to 31 Days from the time of sending
"1M" to "12M" - 1 Month to 12 Months from the time of sending
It is optional to include the Expiry attribute with the WAP Push message. If it
is not to be included then set the Expiry property as "0" (i.e. the WAP Push
never expires).
Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)
mCore.WapPushException
mCore.GeneralException
| Visual Basic |
| Public Class MyClass Public WithEvents objSMS As New mCore.SMS Public Sub SendWapPush() Dim objWP As mCore.WapPush = objSMS.WapPush Try SetCommParameters() objWP.Destination = "+919873094767" objWP.Text = "Check your emails online" objWP.URL = "http://www.mobulus.com/mobile" objWP.Action = mCore.WapPushAction.SignalMedium objWP.Created = DateTime.Now objWP.Expiry = "1W" 'To exclude the Expiry attribute use 'objWP.Expiry = "0" objWP.Send() MsgBox("WAP Push Sent!") Catch ex As mCore.WapPushException MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo") Catch ex As mCore.GeneralException MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo") Catch ex As Exception End Try End Sub Public Sub SetCommParameters() Try objSMS.Port = "COM1" objSMS.BaudRate = mCore.BaudRate.BaudRate_19200 objSMS.DataBits = mCore.DataBits.Eight objSMS.StopBits = mCore.StopBits.One objSMS.Parity = mCore.Parity.None objSMS.FlowControl = mCore.FlowControl.RTS_CTS Catch ex As mCore.GeneralException MsgBox(ex.Message) Catch ex As Exception End Try End Function End Class |
| C# |
| class MyClass { public mCore.SMS objSMS = new mCore.SMS(); public static void SendWapPush() { mCore.WapPush objWP = objSMS.WapPush(); try {
SetCommParameters(); catch (mCore.WapPushException e) catch
(mCore.GeneralException e) |
mCore.SMS.WapPush
Method
WapPush.Destination Property
WapPush.Text Property
WapPush.URL Property
WapPush.Action Property
WapPush.Created Property
WapPush.IsLengthOK Property
WapPush.Send Method