/apidoc/Titanium/Network/Network.yml

https://github.com/bataboske/titanium_mobile · YAML · 214 lines · 214 code · 0 blank · 0 comment · 0 complexity · ab158f4646e4f3529215a98d3267c8b7 MD5 · raw file

  1. ---
  2. name: Titanium.Network
  3. description: The top level Network module. The Network module is used accessing Networking related functionality, including [Titanium.Network.Socket](Titanium.Network.Socket-module.html)
  4. extends: Titanium.Module
  5. since: "0.1"
  6. methods:
  7. - name: addConnectivityListener
  8. description: adds a connectivity listener to listen for network changes. This method has been deprecated in favor of listening for a `change` event.
  9. deprecated:
  10. since: "1.7.0"
  11. parameters:
  12. - name: callback
  13. description: callback function to invoke upon network connectivity changes
  14. type: Callback<Object>
  15. - name: createBonjourBrowser
  16. description: create and return an instance of <Titanium.Network.BonjourBrowser>
  17. platforms: [iphone, ipad]
  18. returns:
  19. type: Titanium.Network.BonjourBrowser
  20. parameters:
  21. - name: serviceType
  22. description: service to search for, must include the protocol type suffix (._tcp)
  23. type: String
  24. - name: domain
  25. description: the Bonjour service domain to conduct the search in. Default value is 'local.'
  26. default: local.
  27. type: String
  28. - name: parameters
  29. optional: true
  30. description: A dictionary object of properties defined in <Titanium.Network.BonjourBrowser>
  31. type: Dictionary<Titanium.Network.BonjourBrowser>
  32. - name: createBonjourService
  33. description: create and return an instance of <Titanium.Network.BonjourService>
  34. platforms: [iphone, ipad]
  35. returns:
  36. type: Titanium.Network.BonjourService
  37. parameters:
  38. - name: name
  39. description: the name of the service. Must be a unique identifier for this service type and domain.
  40. type: String
  41. - name: type
  42. description: the type of service. Must include the protocol identifier (._tcp)
  43. type: String
  44. - name: domain
  45. description: the domain to publish the service in. Default value is 'local.'
  46. default: local.
  47. type: String
  48. - name: parameters
  49. description: A dictionary object with properties defined in <Titanium.Network.BonjourService>
  50. optional: true
  51. type: Dictionary<Titanium.Network.BonjourService>
  52. - name: createTCPSocket
  53. description: create and return an instance of <Titanium.Network.TCPSocket>
  54. platforms: [iphone, ipad]
  55. deprecated:
  56. since: "1.7.0"
  57. returns:
  58. type: Titanium.Network.TCPSocket
  59. parameters:
  60. - name: hostName
  61. description: the host name to connect to/listen on
  62. type: String
  63. - name: port
  64. description: the port for the socket
  65. type: Number
  66. - name: mode
  67. description: the socket's mode; one of <Titanium.Network.READ_MODE>, <Titanium.Network.WRITE_MODE>, <Titanium.Network.READ_WRITE_MODE>
  68. type: Number
  69. - name: parameters
  70. description: A dictionary object with properties defined in <Titanium.Network.TCPSocket>
  71. type: Object
  72. - name: decodeURIComponent
  73. description: decode a URI component part using URI encoding
  74. returns:
  75. type: String
  76. parameters:
  77. - name: value
  78. description: input value to be decoded
  79. type: String
  80. - name: encodeURIComponent
  81. description: encode a URI component part using URI encoding
  82. returns:
  83. type: String
  84. parameters:
  85. - name: value
  86. description: input value to be encoded
  87. type: String
  88. - name: registerForPushNotifications
  89. description: register for push notifications with the Apple Push Notification Service.
  90. platforms: [iphone, ipad]
  91. parameters:
  92. - name: config
  93. description: |
  94. dictionary of the following: `types` is an array of type constants that the application would like to receive, `success` is a callback function that is called when the push registration is successfully completed, `error` is a callback function that is called when an error is received during registration and `callback` is a callback function that is invoked upon receiving a new push notification. This method should be called at application startup.
  95. type: Object
  96. - name: removeConnectivityListener
  97. description: removes a connectivity listener. This method has been deprecated in favor of listening for a `change` event.
  98. deprecated:
  99. since: "1.7.0"
  100. parameters:
  101. - name: callback
  102. description: callback function to remove
  103. type: Callback<Object>
  104. events:
  105. - name: change
  106. description: fired upon a network connectivity change
  107. properties:
  108. - name: networkTypeName
  109. description: the new network type as a string
  110. - name: online
  111. description: boolean to indicate if the network is online
  112. - name: networkType
  113. description: the new network type
  114. properties:
  115. - name: INADDR_ANY
  116. description: constant value representing the ability for sockets to listen on any locally available network device
  117. type: String
  118. permission: read-only
  119. - name: NETWORK_LAN
  120. description: constant value to indicate that the network is LAN
  121. type: Number
  122. permission: read-only
  123. - name: NETWORK_MOBILE
  124. description: constant value to indicate that the network is MOBILE
  125. type: Number
  126. permission: read-only
  127. - name: NETWORK_NONE
  128. description: constant value to indicate that the network is not available
  129. type: Number
  130. permission: read-only
  131. - name: NETWORK_UNKNOWN
  132. description: constant value to indicate that the network is not known
  133. type: Number
  134. permission: read-only
  135. - name: NETWORK_WIFI
  136. description: constant value to indicate that the network is WIFI
  137. type: Number
  138. permission: read-only
  139. - name: NOTIFICATION_TYPE_ALERT
  140. description: constant value for the push notification alert type
  141. platforms: [iphone, ipad]
  142. permission: read-only
  143. type: Number
  144. - name: NOTIFICATION_TYPE_BADGE
  145. description: constant value for the push notification badge type
  146. type: Number
  147. permission: read-only
  148. platforms: [iphone, ipad]
  149. - name: NOTIFICATION_TYPE_SOUND
  150. description: constant value for the push notification sound type
  151. type: Number
  152. permission: read-only
  153. platforms: [iphone, ipad]
  154. - name: READ_MODE
  155. description: constant value specifying read-only mode for sockets
  156. type: Number
  157. permission: read-only
  158. - name: READ_WRITE_MODE
  159. description: constant value specifying read-write mode for sockets
  160. type: Number
  161. permission: read-only
  162. - name: SOCKET_CLOSED
  163. description: constant value representing a socket in the CLOSED state
  164. type: Number
  165. permission: read-only
  166. platforms: [iphone, ipad]
  167. - name: SOCKET_CONNECTED
  168. description: constant value representing a socket in the CONNECTED state
  169. type: Number
  170. permission: read-only
  171. platforms: [iphone, ipad]
  172. - name: SOCKET_ERROR
  173. description: constant value representing a socket in the ERROR state
  174. type: Number
  175. permission: read-only
  176. platforms: [iphone, ipad]
  177. - name: SOCKET_INITIALIZED
  178. description: constant value representing a socket in the INITIALIZED state
  179. type: Number
  180. permission: read-only
  181. platforms: [iphone, ipad]
  182. - name: SOCKET_LISTENING
  183. description: constant value representing a socket in the LISTENING state
  184. type: Number
  185. permission: read-only
  186. platforms: [iphone, ipad]
  187. - name: WRITE_MODE
  188. description: constant value specifying write-only mode for sockets
  189. type: Number
  190. permission: read-only
  191. - name: networkType
  192. description: the network type value as a constant.
  193. type: Number
  194. permission: read-only
  195. - name: networkTypeName
  196. description: the network type name constant. Returns one of `NONE`, `WIFI`, `LAN` or `MOBILE`.
  197. type: String
  198. permission: read-only
  199. - name: online
  200. description: boolean value that indicates if the network is reachable to the Internet either via WIFI or Carrier network
  201. type: Boolean
  202. permission: read-only
  203. - name: remoteDeviceUUID
  204. description: the remote device UUID if the device was registered with the Apple Push Notification Service or null if not set.
  205. platforms: [iphone, ipad]
  206. type: String
  207. - name: remoteNotificationTypes
  208. description: returns an array of network type constants enabled for the application.
  209. platforms: [iphone, ipad]
  210. type: Array<Object>
  211. - name: remoteNotificationsEnabled
  212. description: returns true if remote notifications have been enabled.
  213. platforms: [iphone, ipad]
  214. type: Boolean