## com.gs.sms.api

# SmsManagerApi

All apis of Sms

### Supported Products:

All

# Detail

## Method

method | description
--- | ---
`public static` `boolean` `resendFailedSms`(`long` smsId); | Find the sms from database by the smsId,and send it again. ### Params: smsId The id of sms which need to be send again. Make sure the smsId is exist in sms database,or it maybe return fail. smsId 要再次发送的消息ID 确保当前Id在sms数据库中存在，否则发送会失败 ### Return: boolean true:Success adding to the sending queue. false:Fail adding to the sending queue. ### Supported Products: All
`public static` `long` `sendSmsAfterSaved`(`int` from, `String` to, `String` content); | Save sms to database and then add to the sending queue. Saving operation is done at current thread. ### Params: from The local accountId for sending SMS. to The phone number for receiving SMS. content The content of the SMS. We do not specifically limited the number of characters. But due to AIDL or app memory or database capacity,if the content is too large, it may return false. We recommend the limit size of content is 1024 byte. ### Return: long >=0:The msgId of the saved sms. <0:Save fail. unable to be added to the sending queue. ### Supported Products: All
`public static` `long` `sendSmsAfterSaved`(`int` from, `String` to, `String` group, `String` content); | Save sms to database and then add to the sending queue. Saving operation is done at current thread. ### Params: from The local accountId for sending SMS. to The phone number for receiving SMS. group The group which the SMS belongs to. The format of the group is "number1_,number2_,number3..". If the group dose not contain the param "to" or the group can not be parsed,this sms will be added fail. So before calling this method,make sure the input group is right. If the group equals "to",then this api function is same to {@link SmsManagerApi#sendSmsAfterSaved(int, String, String)} content The content of the SMS. We do not specifically limited the number of characters. But due to AIDL or app memory or database capacity,if the content is too large, it may return false. We recommend the limit size of content is 1024 byte. ### Return: long >=0:The msgId of the saved sms. <0:Save fail. ### Supported Products: All
`public static` `boolean` `addSmsListener`(`SmsListener` smsListener); | Add smsListener for monitoring sms send result. ### Params: smsListener The listener for monitoring sms send result. ### Return: boolean true:Success;false:Fail. ### Supported Products: All
`public static` `int` `removeSmsById`(`long` smsId); | Remove a sms by sms id. ### Params: smsId The sms id that need to be removed. smsId 短信ID ### Return: int >= 0 means rows that have been removed; <0 remove fail.
`public static` `int` `removeSmsByType`(`int` removeType); | Remove a sort of SMSs by removeType. ### Params: removeType What kind of SMSs that need to be removed.Refer to {@link SmsContext.RemoveType} removeType 要删除的短信类型 参考 {@link SmsContext.RemoveType} ### Return: int greater than or equal to 0 means rows that removed, or else means error.

## Member & Constant

Member | description
--- | ---
`public static final` `String` `API` | The tag name of SmsManagerApi,which is used in {@link com.gs.common.client.ApiClient.Builder#addApi(String)} ### Supported Products: All