Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: gamedivisionuk on December 24, 2012, 06:46:09 AM

Title: Send text message to mobile phone button
Post by: gamedivisionuk on December 24, 2012, 06:46:09 AM
I had 2 issues I've managed to solve 1 of them and that was,make a phone call button with this script attached to an NGUi button

using UnityEngine;
using System.Collections;

public class button : MonoBehaviour {

// Use this for initialization
void Start () {

}

void OnClick() {
Application.OpenURL("tel:07979566922");
}
}

Now the other issue which I have no clue what so ever to achieve is,creating a text message button,exactly the same as the phone button pre-made text message to a mobile number.
Each person will have a button under their name all the user will have to do is press that button and it will send a standard message to that person,no messing around typing or inputting numbers,how would I go about making this NGui button
Hope someone can help
Thank you



Title: Re: Send text message to mobile phone button
Post by: ArenMook on December 24, 2012, 08:00:06 AM
I'm not sure I understand the question. Have a script on your button with OnClick() in it, and do what you want inside.
Title: Re: Send text message to mobile phone button
Post by: gamedivisionuk on December 24, 2012, 08:47:30 AM
I'm not sure I understand the question. Have a script on your button with OnClick() in it, and do what you want inside.

Say if you want to send a text message to your friend you have to open up a new message write the message then input his number then press send,I want to be able to just have a button with the message and phone number already attached so all you have to do is press send
Title: Re: Send text message to mobile phone button
Post by: gamedivisionuk on December 24, 2012, 10:36:40 AM
Maybe I'm getting my words mixed up,send an SMS via a simple button
Title: Re: Send text message to mobile phone button
Post by: ArenMook on December 24, 2012, 11:19:14 AM
I have no idea how to send an SMS, and it has nothing to do with NGUI.
Title: Re: Send text message to mobile phone button
Post by: gamedivisionuk on December 24, 2012, 03:30:05 PM
I have no idea how to send an SMS, and it has nothing to do with NGUI.

i merely asking a question( i thought thats what forums are for) could i add a script to an ngui button and send an sms,so if im using ngui and I'm asking about ngui then i think it has alot to do with ngui,i don't understand why you would say that.
Title: Re: Send text message to mobile phone button
Post by: ArenMook on December 24, 2012, 04:02:17 PM
As I mentioned in my first reply -- create a custom script, attach it to your button. Inside that script have "void OnClick() {...}", and replace "..." with the code that does your SMS logic. Triggering of an event = NGUI, and that's "OnClick" = trivial and explained thoroughly many times over. Sending an SMS logic = outside of NGUI.
Title: Re: Send text message to mobile phone button
Post by: Nicki on December 24, 2012, 04:29:38 PM
Sending an sms/imessage might be more advanced than just opening an URL. Look into how it's done natively and make a plugin for that functionality. I don't think there's any short cuts for it, I'm afraid.
Title: Re: Send text message to mobile phone button
Post by: gamedivisionuk on December 24, 2012, 04:41:00 PM
Sending an sms/imessage might be more advanced than just opening an URL. Look into how it's done natively and make a plugin for that functionality. I don't think there's any short cuts for it, I'm afraid.

thank you for the polite reply,as im unable to code i think the only option i have is to buy another plugin,the only reason i ask was to see if someone maybe had done it before and could possible help,I'm not asking plp to do the project for me.just help

thank you
Title: Re: Send text message to mobile phone button
Post by: Nicki on December 27, 2012, 11:18:16 AM
We're technically outside the scope of NGUI, so I won't dig more into this for now. But look here
http://stackoverflow.com/questions/10848/how-to-programmatically-send-sms-on-the-iphone

As far as I know, there's no plugins made for it, at least on iOS. Best of luck finding one or getting it to work. :)