uniapp原生sdk插件极光短信·极光短信插件可快速对接收发短信·官方伙伴优雅草发布

下载地址:https://ext.dcloud.net.cn/plugin?id=4773

极光短信sdk,支持短信和语音短信,可用于验证码,系统通知,营销推广,极光推送补充

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DWAENMgh-1618893531451)(https://doc.youyacao.com/server/index.php?s=/api/attachment/visitFile/sign/4c96c2a48609df62a411f3c5a5ef36ea)]

使用方法:

请直接下载实例文件

<template>
    <view>
        <view class="uni-padding-wrap uni-common-mt">   
		
		
		
						 <button  @tap="initSdk()">initSdk</button> 
				          <button  @tap="setIntervalTime()">setIntervalTime</button> 	
						 <button  @tap="getIntervalTime()">getIntervalTime</button> 
						 <button  @tap="getSmsCodeAsyn()">getSmsCodeAsyn</button>
						  <button  @tap="getVoiceCode()">getVoiceCode</button> 
						  <button  @tap="checkSmsCodeAsyn()">checkSmsCodeAsyn</button> 	
						
				 	        </view>
    </view>
</template>
<script>
	const Jsms = uni.requireNativePlugin('youyacao-Jsms');
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		methods: {
			initSdk()
			{
				Jsms.initSdk({ }, result => {
					const msg = JSON.stringify(result);
					uni.showModal({
						content: msg,
						showCancel: false
					}); 
				}); 
			},
			setIntervalTime()
			{
				Jsms.setIntervalTime({ 
					IntervalTime:60000 //60秒
				}, result => {
					const msg = JSON.stringify(result);
					uni.showModal({
						content: msg,
						showCancel: false
					}); 
				}); 
			},
			getIntervalTime()
			{
				Jsms.getIntervalTime({ }, result => {
					const msg = JSON.stringify(result);
					uni.showModal({
						content: msg,
						showCancel: false
					}); 
				}); 
			},
			 getSmsCodeAsyn()
			 {
			 
			 	Jsms.getSmsCodeAsyn({
					phone:"15159292131",
					tempId:"1"
				}, result => {
			 		const msg = JSON.stringify(result);
			 		uni.showModal({
			 			content: msg,
			 			showCancel: false
			 		}); 
			 	}); 
			 },
			  getVoiceCode()
			  {
			  	Jsms.getVoiceCode({ 
						phone:"15159292131"
				}, result => {
			  		const msg = JSON.stringify(result);
			  		uni.showModal({
			  			content: msg,
			  			showCancel: false
			  		}); 
			  	}); 
			  },
			  checkSmsCodeAsyn()
			  {
			  	Jsms.checkSmsCodeAsyn({
					phone:"15159292131",
					code:"123456"
				}, result => {
			  		const msg = JSON.stringify(result);
			  		uni.showModal({
			  			content: msg,
			  			showCancel: false
			  		}); 
			  	}); 
			  },
		}
	}
</script>
<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200upx;
		width: 200upx;
		margin-top: 200upx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50upx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36upx;
		color: #8f8f94;
	}
</style>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

优雅草·央千澈

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值