SmsManager.SendDataMessage 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
deprecated
發送基於資料的簡訊到特定的應用程式埠口。
[Android.Runtime.Register("sendDataMessage", "(Ljava/lang/String;Ljava/lang/String;S[BLandroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "")]
[System.Obsolete("deprecated")]
public void SendDataMessage(string? destinationAddress, string? scAddress, short destinationPort, byte[]? data, Android.App.PendingIntent? sentIntent, Android.App.PendingIntent? deliveryIntent);
[<Android.Runtime.Register("sendDataMessage", "(Ljava/lang/String;Ljava/lang/String;S[BLandroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "")>]
[<System.Obsolete("deprecated")>]
member this.SendDataMessage : string * string * int16 * byte[] * Android.App.PendingIntent * Android.App.PendingIntent -> unit
參數
- destinationAddress
- String
要傳送訊息的地址
- scAddress
- String
是服務中心地址或空,使用當前預設的 SMSC
- destinationPort
- Int16
傳送訊息的埠口
- data
- Byte[]
要發送的訊息內容
- sentIntent
- PendingIntent
若未 NULL PendingIntent ,則在訊息成功傳送或失敗時廣播。
結果碼會顯示Activity.RESULT_OK成功,或以下其中一種錯誤:RESULT_ERROR_GENERIC_FAILURERESULT_ERROR_RADIO_OFFRESULT_ERROR_NULL_PDU 。
基於每個應用程式的簡訊控制檢查是發送意圖。 若 sentIntent 為 NULL,呼叫者將被檢查所有未知應用程式,導致檢查期間發送的簡訊數量減少。
- deliveryIntent
- PendingIntent
若非 NULL PendingIntent ,則在訊息送達接收端時即廣播此訊息。 狀態報告的原始 PDU 則在擴展資料(「pdu」)中。
- 屬性
例外狀況
若 destinationAddress 或資料為空
備註
發送基於資料的簡訊到特定的應用程式埠口。
已取代這個成員。 使用 android.telephony.SmsManager。
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。