3 Replies Latest reply on Apr 9, 2015 8:46 AM by aanjan RSS
    sureshc Newbie

    iOS SDK - Issue with Logging with Thinkworkz server.

    <p></p>h3. Issue with connecting the ThingWorkx Server Using iOS SDK:

    <p style="margin: 0px;">I am trying with the “Example App” (SteamSensor) given in the iOS SDK-1.0.1.2 which is downloaded from the thingworkX.com site, with the below Parameters as inputs.</p>

    <p style="margin: 0px; min-height: 11px;"><br></p>

    <p style="margin: 0px;">Host = XXX.XX.X.XX;</p>

    <p style="margin: 0px;">Port = XXXX;</p>

    <p style="margin: 0px;">API Key = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX;</p>

    <p style="margin: 0px;">Thing Name = XX-XXX;</p>

    <p style="margin: 0px; min-height: 11px;"><br></p>

    <p style="margin: 0px; min-height: 11px;"><br></p>

    <p style="margin: 0px;"><u>Also tried with different API Key</u></p>

    <p style="margin: 0px; min-height: 11px;"><br></p>

    <p style="margin: 0px;">API Key = XXXXXXXX-XXXX-XXXX-XXXX-00XXXXXXXXXX;</p>

    <p style="margin: 0px; min-height: 11px;"><br></p><p style="margin: 0px; min-height: 11px;">But it was returning the Error Alert(popup) from iOS that<b> "Error Connecting:" Could not initiate a connection to the server.There was an error initialising the socket.Code 1001. In both the cases.</b></p><p style="margin: 0px; min-height: 11px;"><br></p><p class="MsoNormal"><span lang="EN-US"><b>From the coding side, we are getting the error</b><o:p></o:p></span></p><p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US"><o:p> //</o:p></span> Tell ThingWorx to connect to the server and

    start exchanging message</p><p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US">err = [[</span><span lang="EN-US">ThingWorx</span><span lang="EN-US"> </span><span lang="EN-US">connectedThingClient</span><span lang="EN-US">] </span><span lang="EN-US">connect</span><span lang="EN-US">];</span></p><p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US">if</span><span lang="EN-US"> (err)</span> {</p><p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US"><span style="mso-spacerun:yes">  </span>[</span><span lang="EN-US">ThingWorx</span><span lang="EN-US"> </span><span lang="EN-US">shutDown</span><span lang="EN-US">];<o:p></o:p></span></p><p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US"><span style="mso-spacerun:yes">  </span>[</span><span lang="EN-US">self</span><span lang="EN-US"> </span><span lang="EN-US">showMessageWithTitle</span><span lang="EN-US">:</span><span lang="EN-US">@"Error

    Connecting"</span><span lang="EN-US"> </span><span lang="EN-US">message</span><span lang="EN-US">:[err

    </span><span lang="EN-US">localizedDescription</span><span lang="EN-US">] </span><span lang="EN-US">cancelButtonTitle</span><span lang="EN-US">:</span><span lang="EN-US">@"Done"  <span class="Apple-tab-span" style="white-space:pre">                                                                                          </span></span><span lang="EN-US">shouldResetButtons</span><span lang="EN-US">:</span><span lang="EN-US">YES</span><span lang="EN-US">];</span></p><p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US">  return</span><span lang="EN-US">;</span></p><p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US">}</span></p>h3. Can any one please suggest me, to fix this issue (or) any other alternative to bypass the API Key in connecting to the server.

    <p class="MsoNormal" style="mso-pagination:none;tab-stops:43.3pt;mso-layout-grid-align:

    none;text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Menlo Regular&quot;;color:black"><br></span></p><p></p>