SmsManager.SendTextMessageWithoutPersisting 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發送以簡訊為基礎的簡訊,但不寫入 SMS 服務提供者。
[Android.Runtime.Register("sendTextMessageWithoutPersisting", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "", ApiSince=28)]
public void SendTextMessageWithoutPersisting(string? destinationAddress, string? scAddress, string? text, Android.App.PendingIntent? sentIntent, Android.App.PendingIntent? deliveryIntent);
[<Android.Runtime.Register("sendTextMessageWithoutPersisting", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "", ApiSince=28)>]
member this.SendTextMessageWithoutPersisting : string * string * string * Android.App.PendingIntent * Android.App.PendingIntent -> unit
參數
- destinationAddress
- String
目的地電話號碼。
- scAddress
- String
服務中心地址,或為空,使用目前預設的簡訊服務中心。
- text
- String
簡訊內容。
- sentIntent
- PendingIntent
一個可選的待處理意圖,當傳送操作完成時會被通知。
- deliveryIntent
- PendingIntent
一個可選的待處理意圖,當收到交付報告時會通知。
- 屬性
備註
發送以簡訊為基礎的簡訊,但不寫入 SMS 服務提供者。
訊息將直接透過網路傳送,且不會在簡訊應用程式中顯示。 僅供內部攜帶者使用。
需要權限:同時android.Manifest.permission#SEND_SMSandroid.Manifest.permission#MODIFY_PHONE_STATE且 ,或呼叫應用程式擁有營運商權限(參見TelephonyManager#hasCarrierPrivileges),或呼叫應用程式為預設的 IMS 應用程式(參見CarrierConfigManager#KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING)。
<strong>注意:</strong> 此方法供電信業者應用程式或電話框架內部使用,且永遠不會觸發簡訊消歧對話。 如果在擁有多個有效訂閱的裝置上呼叫此方法,且 SmsManager 該實例已建立為 #getDefault(),且未定義使用者定義的預設訂閱,則與此訊息相關的訂閱 ID 將為 INVALID,導致簡訊會發送到與邏輯槽 0 相關的訂閱。 用 #getSmsManagerForSubscriptionId(int) 來確保簡訊是用正確的訂閱方式發送的。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。