Skip to content

Commit

Permalink
バックグラウンドでも位置情報を送信するように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltask committed Aug 12, 2011
1 parent f7e6209 commit 7cc5bde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Resources/client.js
Expand Up @@ -9,6 +9,7 @@

self.clientId = null;
self.platformId = platformId;
self.retry = true;
self.socket = Ti.Network.createTCPSocket({
hostName: 'ec2-175-41-255-195.ap-northeast-1.compute.amazonaws.com',
// hostName: 'localhost',
Expand All @@ -22,7 +23,7 @@
-function() {
var timer = setInterval(function() {
self.send('ping');
}, 1000);
}, 5000);

self.on('bye', function(data) {
clearTimeout(timer);
Expand All @@ -38,7 +39,7 @@
});

self.connect = function() {
this.socket.connect();
self.socket.connect();
return self;
};

Expand Down
3 changes: 3 additions & 0 deletions tiapp.xml
Expand Up @@ -33,6 +33,9 @@
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
<backgroundModes>
<mode>location</mode>
</backgroundModes>
</iphone>
<android xmlns:android="http://schemas.android.com/apk/res/android">
</android>
Expand Down

0 comments on commit 7cc5bde

Please sign in to comment.