Unity send SMS message

℡╲_俬逩灬. 提交于 2019-12-10 18:52:03

问题


I'm currently using Unity for developing an application for Android and IOS and I'm able to use the function: Application.OpenURL("mailto:" + email_address + "?subject=Email&body=msg from Unity");

to send emails from within my application, and I know you can use a similar function to open up the mobile devices SMS system however I'm unsure on how to actually go about this.

If anyone can please advise how I can open up the native SMS system through "Application.OpenURL()" that'd be fantastic. I'm also open to using an alternative solution if anyone's aware.


回答1:


You can use a variety of OpenURL commands to open up numerous apps in iOS. Android has a comparable nomenclature too. Of course I don't know if below will work in Android but it's worth a shot.

       var sms_number : String = "+17032129831"
       Application.OpenURL("sms:" + sms_number);


来源:https://stackoverflow.com/questions/17948412/unity-send-sms-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!