NimbleKit - fast iOS app development

NKSMSCompser not working in IOS5.0 on device

Problem discussions

NKSMSCompser not working in IOS5.0 on device

Postby llama » Fri Jan 27, 2012 5:22 pm

Hi guys anyone else been testing NKSMSComposer on a device with IOS5.0 it seems to not work...

is imessage causing an issue

/####### code below #########/

var sendmessage = new NKSMSComposer();
sendmessage.setRecipient('93938732762');
sendmessage.show();


cheers
llama
NimbleKit Expert
 
Posts: 77
Joined: Sun Aug 01, 2010 9:24 am
Location: UK, England

Re: NKSMSCompser not working in IOS5.0 on device

Postby cactuscraig » Mon Feb 13, 2012 1:16 am

This code on my iPhone 4 brings up the SMS window:
Code: Select all
<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="NKit.js"></script>
    <script type="text/javascript">
        function onPageShown(caller)
        {
            if (caller!="") //I don't care what the caller is really, tab, nav or window - just open the SMS window
            {
                var sendmessage = new NKSMSComposer();
                sendmessage.setRecipient('93938732762');
                sendmessage.show();
            }
        }
       
       
        </script>
   
</head>
<body>
   
   
</body>
</html>
User avatar
cactuscraig
 
Posts: 846
Joined: Thu Feb 03, 2011 5:15 pm
Location: Scottsdale, AZ

Re: NKSMSCompser not working in IOS5.0 on device

Postby npalmqvist » Fri Jun 01, 2012 4:27 pm

cactuscraig wrote:This code on my iPhone 4 brings up the SMS window:
Code: Select all
<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="NKit.js"></script>
    <script type="text/javascript">
        function onPageShown(caller)
        {
            if (caller!="") //I don't care what the caller is really, tab, nav or window - just open the SMS window
            {
                var sendmessage = new NKSMSComposer();
                sendmessage.setRecipient('93938732762');
                sendmessage.show();
            }
        }
       
       
        </script>
   
</head>
<body>
   
   
</body>
</html>


Having the same problem. When running your code nothing happens. No SMS view, no errors, no nothing...

** UPDATE **
Running the same code in simulator brings up an alert "This device is not configured to send messages" so I'm guessing it's calling the right thing, but on actual device still nothing happens....
npalmqvist
 
Posts: 106
Joined: Thu Feb 17, 2011 10:07 pm
Location: Stockholm, SWEDEN

Re: NKSMSCompser not working in IOS5.0 on device

Postby cactuscraig » Sun Jun 03, 2012 1:07 am

I modified slightly to get away from the onPageShown - and this works for sure when you tap the button:
Code: Select all
<html>
    <head>
        <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <script type="text/javascript" src="NKit.js"></script>
        <script type="text/javascript">
            function doSMS(caller)
            {
               
                    var sendmessage = new NKSMSComposer();
                    sendmessage.setRecipient('93938732762');
                    sendmessage.show();
               
            }
           
            var nkb = new NKButton();
            nkb.init(0,0,50,50,"doSMS");
            nkb.setTitle("SMS");
            nkb.show();
           
            </script>
       
    </head>
    <body>
       
       
    </body>
</html>
User avatar
cactuscraig
 
Posts: 846
Joined: Thu Feb 03, 2011 5:15 pm
Location: Scottsdale, AZ

Re: NKSMSCompser not working in IOS5.0 on device

Postby npalmqvist » Sun Jun 03, 2012 1:16 pm

cactuscraig wrote:I modified slightly to get away from the onPageShown - and this works for sure when you tap the button:
Code: Select all
<html>
    <head>
        <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <script type="text/javascript" src="NKit.js"></script>
        <script type="text/javascript">
            function doSMS(caller)
            {
               
                    var sendmessage = new NKSMSComposer();
                    sendmessage.setRecipient('93938732762');
                    sendmessage.show();
               
            }
           
            var nkb = new NKButton();
            nkb.init(0,0,50,50,"doSMS");
            nkb.setTitle("SMS");
            nkb.show();
           
            </script>
       
    </head>
    <body>
       
       
    </body>
</html>


copy-pasted your code into a new html-file in my project and navigated to it in my app (on device), but when pressing SMS-button nothing happens, nothing at all.... What am I missing???
npalmqvist
 
Posts: 106
Joined: Thu Feb 17, 2011 10:07 pm
Location: Stockholm, SWEDEN

Re: NKSMSCompser not working in IOS5.0 on device

Postby francisco » Sun Jun 03, 2012 3:47 pm

Hi,

In line
Code: Select all
function doSMS(caller)
you are waiting for a parameter. This is correct ?
Maybe should be
Code: Select all
function doSMS()
??

Regards.
Francisco.
User avatar
francisco
NimbleKit Guru
 
Posts: 163
Joined: Thu Dec 01, 2011 12:45 pm
Location: Barcelona, Spain


Return to Troubleshooting

Who is online

Users browsing this forum: Google [Bot] and 1 guest