项目作者: icerockdev

项目描述 :
Sms sending service for kotlin - part of BOKO libs
高级语言: Kotlin
项目地址: git://github.com/icerockdev/sms-service.git
创建时间: 2020-02-10T07:30:34Z
项目社区:https://github.com/icerockdev/sms-service

开源协议:Apache License 2.0

下载


Sms service

Installation

  1. // Append repository
  2. repositories {
  3. mavenCentral()
  4. }
  5. // Append dependency
  6. implementation("com.icerockdev.service:sms-service:1.0.0")

Library usage

Twilio

  1. private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())
  2. private val smsService = SmsService(
  3. scope,
  4. TwilioDriver(
  5. TwilioConfig(
  6. accountSID = "sid",
  7. authToken = "token",
  8. phone = "<fromNumber>"
  9. )
  10. )
  11. )

Sms4b

  1. private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())
  2. private val smsService = SmsService(
  3. scope,
  4. Sms4bDriver(
  5. Sms4bConfig(
  6. login = "login",
  7. password = "pass",
  8. source = "<Sender string>"
  9. )
  10. )
  11. )

Sending

  1. runBlocking {
  2. smsService
  3. .sendAsync("<toNumber>", "TEST MESSAGE")
  4. .await()
  5. }

Contributing

All development (both new features and bug fixes) is performed in the develop branch. This way master always contains the sources of the most recently released version. Please send PRs with bug fixes to the develop branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in master.

The develop branch is pushed to master on release.

For more details on contributing please see the contributing guide.

License

  1. Copyright 2020 IceRock MAG Inc.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.