 					reject()
 				socket.on 'connect_timeout', ->
 					reject()
-					
+			
+			# power saving or reduce network traffic		
+			document.addEventListener 'pause', ->
+				socket._raw.disconnect()
+				
+			document.addEventListener 'resume', ->
+				socket._raw.connect()
+			
 			(method, url, post, callback, headers, timeout, withCredentials, responseType) ->
-				p
+				backend
 					.then ->
 						io.socket = socket
 						opts = 

		$ionicConfigProvider.tabs.style 'standard'
		$ionicConfigProvider.tabs.position 'bottom'

	# define sails socket backend setting and initialie the backend
	.config ($provide) ->
		$provide.decorator '$sailsSocketBackend', ($delegate, $injector, $log) ->
			# socket connect

					else
						location.hash = data.additionalData.data.url
				
				push.on 'error', alert