Author Topic: Send text message to mobile phone button  (Read 7963 times)

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Send text message to mobile phone button
« 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




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Send text message to mobile phone button
« Reply #1 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.

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Send text message to mobile phone button
« Reply #2 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

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Send text message to mobile phone button
« Reply #3 on: December 24, 2012, 10:36:40 AM »
Maybe I'm getting my words mixed up,send an SMS via a simple button

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Send text message to mobile phone button
« Reply #4 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.

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Send text message to mobile phone button
« Reply #5 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Send text message to mobile phone button
« Reply #6 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.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Send text message to mobile phone button
« Reply #7 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.

gamedivisionuk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 36
    • View Profile
Re: Send text message to mobile phone button
« Reply #8 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

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Send text message to mobile phone button
« Reply #9 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. :)