8000 GitHub - linjiajian999/SendMsg: an android app that can send sms on background
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

linjiajian999/SendMsg

Repository files navigation

SendMsg

在安卓设备上,可以调用发短信接口,实现在后台自动发送短信功能

usage

  • 实现安卓原生模块 SendMsgTool
import {
  NativeModules,
  DeviceEventEmitter
} from 'react-native'

const ON_MSG_CALLBACK = 'ON_MSG_CALLBACK'
const NativeSendMsgTool = NativeModules.SendMsgTool

interface MsgCallbackParams {
  info: string
  phone: string
  statusCode: number
  msgId: number
}

let id = 0
let phone = '10086'
let msg = 'hello'
// 发送短信
NativeSendMsgTool.sendMsg(id, phone, msg)
// 可监听短信发送回调
DeviceEventEmitter.addListener(
  ON_MSG_CALLBACK,
  (params: MsgCallbackParams) => {
     console.log(params)
  }
)

详情可参考 send-msg-tool.ts
安卓主要代码实现 iOS代码实现

  • iOS由于api限制,不能自动发送短信,只实现了APP内调起发送短信界面,需要手动发送
  • 主要功能已实现

About

an android app that can send sms on background

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0