@maccesar/titools 3.3.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +27 -61
  2. package/lib/cleanup.js +29 -0
  3. package/lib/commands/agents.js +8 -7
  4. package/lib/commands/skills.js +118 -23
  5. package/lib/config.js +13 -15
  6. package/lib/installer.js +5 -3
  7. package/lib/utils.js +36 -0
  8. package/package.json +1 -1
  9. package/skills/alloy-guides/SKILL.md +188 -0
  10. package/skills/alloy-guides/references/CLI_TASKS.md +233 -0
  11. package/skills/alloy-guides/references/CONCEPTS.md +171 -0
  12. package/skills/alloy-guides/references/CONTROLLERS.md +279 -0
  13. package/skills/alloy-guides/references/MODELS.md +742 -0
  14. package/skills/alloy-guides/references/MODELS_ADVANCED.md +482 -0
  15. package/skills/alloy-guides/references/PURGETSS.md +57 -0
  16. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +235 -0
  17. package/skills/alloy-guides/references/VIEWS_STYLES.md +375 -0
  18. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +102 -0
  19. package/skills/alloy-guides/references/VIEWS_XML.md +581 -0
  20. package/skills/alloy-guides/references/WIDGETS.md +160 -0
  21. package/skills/alloy-howtos/SKILL.md +179 -0
  22. package/skills/alloy-howtos/references/best_practices.md +121 -0
  23. package/skills/alloy-howtos/references/cli_reference.md +230 -0
  24. package/skills/alloy-howtos/references/config_files.md +158 -0
  25. package/skills/alloy-howtos/references/custom_tags.md +148 -0
  26. package/skills/alloy-howtos/references/debugging_troubleshooting.md +78 -0
  27. package/skills/alloy-howtos/references/samples.md +156 -0
  28. package/skills/purgetss/SKILL.md +6 -3
  29. package/skills/purgetss/references/EXAMPLES.md +8 -6
  30. package/skills/purgetss/references/app-branding.md +5 -0
  31. package/skills/purgetss/references/apply-directive.md +1 -1
  32. package/skills/purgetss/references/class-categories.md +1 -1
  33. package/skills/purgetss/references/class-index-properties.md +618 -0
  34. package/skills/purgetss/references/class-index.md +4 -610
  35. package/skills/purgetss/references/cli-commands.md +15 -0
  36. package/skills/purgetss/references/custom-fonts.md +39 -36
  37. package/skills/purgetss/references/custom-rules.md +1 -1
  38. package/skills/purgetss/references/customization-deep-dive.md +64 -1
  39. package/skills/purgetss/references/icon-fonts.md +2 -0
  40. package/skills/purgetss/references/migration-guide.md +53 -1
  41. package/skills/purgetss/references/multi-density-images.md +53 -2
  42. package/skills/purgetss/references/svg-pipeline.md +249 -0
  43. package/skills/purgetss/references/tikit-components.md +2 -2
  44. package/skills/purgetss/references/titanium-resets.md +2 -2
  45. package/skills/purgetss/references/ui-ux-design.md +7 -5
  46. package/skills/purgetss/references/version-history.md +12 -0
  47. package/skills/ti-api/SKILL.md +128 -0
  48. package/skills/ti-api/references/api-android.md +675 -0
  49. package/skills/ti-api/references/api-app-platform.md +636 -0
  50. package/skills/ti-api/references/api-core.md +764 -0
  51. package/skills/ti-api/references/api-data-network.md +641 -0
  52. package/skills/ti-api/references/api-media.md +655 -0
  53. package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
  54. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
  55. package/skills/ti-api/references/api-modules-map.md +632 -0
  56. package/skills/ti-api/references/api-modules-nfc.md +725 -0
  57. package/skills/ti-api/references/api-modules-social-misc.md +526 -0
  58. package/skills/ti-api/references/api-services.md +700 -0
  59. package/skills/ti-api/references/api-ui-android.md +499 -0
  60. package/skills/ti-api/references/api-ui-extras.md +702 -0
  61. package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
  62. package/skills/ti-api/references/api-ui-ios.md +756 -0
  63. package/skills/ti-api/references/api-ui-lists.md +581 -0
  64. package/skills/ti-api/references/api-ui-text-input.md +607 -0
  65. package/skills/ti-api/references/api-ui-views.md +572 -0
  66. package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
  67. package/skills/ti-api/references/api-xml-global.md +743 -0
  68. package/skills/ti-guides/SKILL.md +82 -0
  69. package/skills/ti-guides/references/advanced-data-and-images.md +155 -0
  70. package/skills/ti-guides/references/android-manifest.md +97 -0
  71. package/skills/ti-guides/references/app-distribution.md +373 -0
  72. package/skills/ti-guides/references/application-frameworks.md +366 -0
  73. package/skills/ti-guides/references/cli-reference.md +700 -0
  74. package/skills/ti-guides/references/coding-best-practices.md +150 -0
  75. package/skills/ti-guides/references/commonjs-advanced.md +279 -0
  76. package/skills/ti-guides/references/hello-world.md +99 -0
  77. package/skills/ti-guides/references/hyperloop-native-access.md +458 -0
  78. package/skills/ti-guides/references/javascript-primer.md +402 -0
  79. package/skills/ti-guides/references/reserved-words.md +36 -0
  80. package/skills/ti-guides/references/resources.md +172 -0
  81. package/skills/ti-guides/references/style-and-conventions.md +104 -0
  82. package/skills/ti-guides/references/tiapp-config.md +655 -0
  83. package/skills/ti-howtos/SKILL.md +131 -0
  84. package/skills/ti-howtos/references/android-platform-deep-dives.md +609 -0
  85. package/skills/ti-howtos/references/automation-fastlane-appium.md +96 -0
  86. package/skills/ti-howtos/references/buffer-codec-streams.md +162 -0
  87. package/skills/ti-howtos/references/cross-platform-development.md +358 -0
  88. package/skills/ti-howtos/references/debugging-profiling.md +473 -0
  89. package/skills/ti-howtos/references/extending-titanium.md +684 -0
  90. package/skills/ti-howtos/references/google-maps-v2.md +172 -0
  91. package/skills/ti-howtos/references/ios-map-kit.md +149 -0
  92. package/skills/ti-howtos/references/ios-platform-deep-dives.md +595 -0
  93. package/skills/ti-howtos/references/local-data-sources.md +310 -0
  94. package/skills/ti-howtos/references/location-and-maps.md +267 -0
  95. package/skills/ti-howtos/references/media-apis.md +268 -0
  96. package/skills/ti-howtos/references/notification-services.md +539 -0
  97. package/skills/ti-howtos/references/remote-data-sources.md +339 -0
  98. package/skills/ti-howtos/references/tutorials.md +552 -0
  99. package/skills/ti-howtos/references/using-modules.md +182 -0
  100. package/skills/ti-howtos/references/web-content-integration.md +288 -0
  101. package/skills/ti-howtos/references/webpack-build-pipeline.md +125 -0
@@ -0,0 +1,411 @@
1
+ # Modules: CoreMotion & URLSession API Reference
2
+
3
+ ## Modules.CoreMotion
4
+ > Allows Titanium client applications to access Apple's CoreMotion APIs.
5
+ > Extends Ti.Module
6
+ > Platforms: ios
7
+ > Type: module
8
+
9
+ The Core Motion module provides access to Apple's CoreMotion APIs. The Core Motion module provides support
10
+ for monitoring various hardware sensors on iOS devices, such as the accelerometer, gyroscope, and
11
+ magnetometer. The Core Motion module allows you to access the metrics provided by these sensors.
12
+
13
+ For instruction and examples of using the Core Motion Module, see the
14
+ [Core Motion Module guide]().
15
+
16
+
17
+ ### Requirements
18
+
19
+ This module only works with devices running iOS 7 and later. Not all devices have the same hardware sensors,
20
+ so all features may not be available for all devices. Be sure to use the API to check the device
21
+ for the existence of a feature.
22
+
23
+ You can only test the Core Motion module on a device. The Core Motion API cannot be tested on the iOS
24
+
25
+ *(See full overview in titanium-docs)*
26
+
27
+ ### Constants (23)
28
+ - **ATTITUDE_REFERENCE_FRAME_X_ARBITRARY_CORRECTED_Z_\***: ATTITUDE_REFERENCE_FRAME_X_ARBITRARY_CORRECTED_Z_VERTICAL
29
+ - **ATTITUDE_REFERENCE_FRAME_X_ARBITRARY_Z_\***: ATTITUDE_REFERENCE_FRAME_X_ARBITRARY_Z_VERTICAL
30
+ - **ATTITUDE_REFERENCE_FRAME_X_MAGNETIC_NORTH_Z_\***: ATTITUDE_REFERENCE_FRAME_X_MAGNETIC_NORTH_Z_VERTICAL
31
+ - **ATTITUDE_REFERENCE_FRAME_X_TRUE_NORTH_Z_\***: ATTITUDE_REFERENCE_FRAME_X_TRUE_NORTH_Z_VERTICAL
32
+ - **AUTHORIZATION_STATUS_\***: AUTHORIZATION_STATUS_RESTRICTED, AUTHORIZATION_STATUS_DENIED, AUTHORIZATION_STATUS_AUTHORIZED
33
+ - **AUTHORIZATION_STATUS_NOT_\***: AUTHORIZATION_STATUS_NOT_DETERMINED
34
+ - **ERROR_\***: ERROR_NULL, ERROR_UNKNOWN
35
+ - **ERROR_DEVICE_REQUIRES_\***: ERROR_DEVICE_REQUIRES_MOVEMENT
36
+ - **ERROR_INVALID_\***: ERROR_INVALID_PARAMETER
37
+ - **ERROR_MOTION_ACTIVITY_NOT_\***: ERROR_MOTION_ACTIVITY_NOT_AVAILABLE, ERROR_MOTION_ACTIVITY_NOT_AUTHORIZED, ERROR_MOTION_ACTIVITY_NOT_ENTITLED
38
+ - **ERROR_TRUE_NORTH_NOT_\***: ERROR_TRUE_NORTH_NOT_AVAILABLE
39
+ - **MAGNETIC_FIELD_CALIBRATION_ACCURACY_\***: MAGNETIC_FIELD_CALIBRATION_ACCURACY_UNCALIBRATED, MAGNETIC_FIELD_CALIBRATION_ACCURACY_LOW, MAGNETIC_FIELD_CALIBRATION_ACCURACY_MEDIUM, MAGNETIC_FIELD_CALIBRATION_ACCURACY_HIGH
40
+ - **MOTION_ACTIVITY_CONFIDENCE_\***: MOTION_ACTIVITY_CONFIDENCE_LOW, MOTION_ACTIVITY_CONFIDENCE_MEDIUM, MOTION_ACTIVITY_CONFIDENCE_HIGH
41
+
42
+
43
+
44
+
45
+ ---
46
+
47
+ ## Modules.CoreMotion.Accelerometer
48
+ > Allows Titanium client applications to access CoreMotion's Accelerometer APIs.
49
+ > Extends Ti.Proxy
50
+ > Platforms: ios
51
+
52
+
53
+ ### Methods (6)
54
+ | Method | Returns | Platform | Description |
55
+ |--------|---------|----------|-------------|
56
+ | setAccelerometerUpdateInterval(interval) | void | ios | The interval in milliseconds, for providing accelerometer updates to the callba… |
57
+ | startAccelerometerUpdates(callback) | void | ios | Starts accelerometer updates. |
58
+ | stopAccelerometerUpdates(—) | void | ios | Stops accelerometer updates. |
59
+ | isAccelerometerActive(—) | Boolean | ios | Returns a Boolean indicating whether accelerometer updates are currently happen… |
60
+ | isAccelerometerAvailable(—) | Boolean | ios | Returns a Boolean indicating whether an accelerometer is available on the devic… |
61
+ | getAccelerometerData(—) | CoreMotionAccelerometerData | ios | Returns the latest sample of accelerometer data. |
62
+
63
+
64
+ ### Related Types
65
+
66
+ #### CoreMotionAccelerometerData
67
+ > Representation of an accelerometer event.
68
+
69
+ | Property | Type | Description |
70
+ |----------|------|-------------|
71
+ | timestamp | Number | The time when the logged item is valid. |
72
+ | acceleration | CoreMotionAcceleration | The acceleration measured by the accelerometer. |
73
+
74
+ ---
75
+
76
+ ## Modules.CoreMotion.Altimeter
77
+ > Allows Titanium client applications to access CoreMotion's Altimeter APIs. Note: This API is only available in iOS 8 and later.
78
+ > Extends Ti.Proxy
79
+ > Platforms: ios
80
+
81
+
82
+ ### Methods (6)
83
+ | Method | Returns | Platform | Description |
84
+ |--------|---------|----------|-------------|
85
+ | isSupported(—) | Boolean | ios | Returns a Boolean value indicating whether the altimeter is supported on the cu… |
86
+ | isRelativeAltitudeAvailable(—) | Boolean | ios | Returns a Boolean value indicating whether the altimeter is supported on the cu… |
87
+ | authorizationStatus(—) | Number | ios | Returns the current authorization status for altimeter. |
88
+ | hasAltimeterPermissions(—) | Boolean | ios | Determines whether the device supports reporting relative altitude changes. |
89
+ | startRelativeAltitudeUpdates(callback) | void | ios | Starts relative altitude updates, providing data to the given handler on the gi… |
90
+ | stopRelativeAltitudeUpdates(—) | void | ios | Stops relative altitude updates. |
91
+
92
+
93
+ ---
94
+
95
+ ## Modules.CoreMotion.DeviceMotion
96
+ > Allows Titanium client applications to access CoreMotion's DeviceMotion APIs.
97
+ > Extends Ti.Proxy
98
+ > Platforms: ios
99
+
100
+
101
+ ### Methods (10)
102
+ | Method | Returns | Platform | Description |
103
+ |--------|---------|----------|-------------|
104
+ | setShowsDeviceMovementDisplay(show) | void | ios | Controls whether the device-movement display is shown. |
105
+ | setDeviceMotionUpdateInterval(interval) | void | ios | The interval in milliseconds, for providing device-motion updates to the callba… |
106
+ | startDeviceMotionUpdatesUsingReferenceFrame(args, callback) | void | ios | Starts device-motion updates using a reference frame. |
107
+ | startDeviceMotionUpdates(callback) | void | ios | Starts device-motion updates. |
108
+ | stopDeviceMotionUpdates(—) | void | ios | Stops device-motion updates. |
109
+ | getAttitudeReferenceFrame(—) | Number | ios | Returns either the reference frame currently being used or the default attitude… |
110
+ | availableAttitudeReferenceFrames(—) | Number | ios | Returns a bitmask specifying the available attitude reference frames on the dev… |
111
+ | isDeviceMotionActive(—) | Boolean | ios | Returns a Boolean value that determines whether the app is receiving updates fr… |
112
+ | isDeviceMotionAvailable(—) | Boolean | ios | Returns a Boolean indicating whether device-motion is available on the device. |
113
+ | getDeviceMotion(—) | CoreMotionDeviceMotionData | ios | Returns the latest sample of device-motion data. |
114
+
115
+
116
+ ### Related Types
117
+
118
+ #### CoreMotionDeviceMotionData
119
+ > Representation of a device-motion event.
120
+
121
+ | Property | Type | Description |
122
+ |----------|------|-------------|
123
+ | timestamp | Number | The time when the logged item is valid. |
124
+ | attitude | CoreMotionAttitude | The attitude of the device. |
125
+ | rotationRate | CoreMotionRotationRate | The roation rate of the device. |
126
+ | gravity | CoreMotionAcceleration | The gravity acceleration vector expressed in the device's reference frame. |
127
+ | userAcceleration | CoreMotionAcceleration | The acceleration that the user is giving to the device. |
128
+ | magneticField | CoreMotionCalibratedMagneticField | Returns the magnetic field vector with respect to the device. |
129
+ | heading | Number | Returns heading angle in the range [0,360) degrees with respect to the attitude… |
130
+
131
+ #### CoreMotionReferenceFrameArgs
132
+ > Dictionary of arguments passed to the [DeviceMotion.startDeviceMotionUpdatesUsingReferenceFrame()](Modules.CoreMotion.DeviceMotion.startDeviceMotionUpdatesUsingReferenceFrame) method.
133
+
134
+ | Property | Type | Description |
135
+ |----------|------|-------------|
136
+ | referenceFrame | Number | A constant identifying the reference frame to use for device-motion updates. |
137
+
138
+ ---
139
+
140
+ ## Modules.CoreMotion.Gyroscope
141
+ > Allows Titanium client applications to access CoreMotion's Gyroscope APIs.
142
+ > Extends Ti.Proxy
143
+ > Platforms: ios
144
+
145
+
146
+ ### Methods (6)
147
+ | Method | Returns | Platform | Description |
148
+ |--------|---------|----------|-------------|
149
+ | setGyroUpdateInterval(interval) | void | ios | The interval in milliseconds, for providing gyroscope updates to the callback. |
150
+ | startGyroUpdates(callback) | void | ios | Starts gyroscope updates. |
151
+ | stopGyroUpdates(—) | void | ios | Stops gyroscope updates. |
152
+ | isGyroActive(—) | Boolean | ios | Returns a Boolean indicating whether gyroscope updates are currently happening. |
153
+ | isGyroAvailable(—) | Boolean | ios | Returns a Boolean indicating whether a gyroscope is available on the device. |
154
+ | getGyroData(—) | CoreMotionGyroData | ios | Returns the latest sample of gyroscope data. |
155
+
156
+
157
+ ### Related Types
158
+
159
+ #### CoreMotionGyroData
160
+ > Representation of a gyroscope event.
161
+
162
+ | Property | Type | Description |
163
+ |----------|------|-------------|
164
+ | timestamp | Number | The time when the logged item is valid. |
165
+ | rotationRate | CoreMotionRotationRate | The rotation rate measured by the gyroscope. |
166
+
167
+ ---
168
+
169
+ ## Modules.CoreMotion.Magnetometer
170
+ > Allows Titanium client applications to access CoreMotion's Magnetometer APIs.
171
+ > Extends Ti.Proxy
172
+ > Platforms: ios
173
+
174
+
175
+ ### Methods (6)
176
+ | Method | Returns | Platform | Description |
177
+ |--------|---------|----------|-------------|
178
+ | setMagnetometerUpdateInterval(interval) | void | ios | The interval in milliseconds, for providing magnetometer updates to the callbac… |
179
+ | startMagnetometerUpdates(callback) | void | ios | Starts magnetometer updates. |
180
+ | stopMagnetometerUpdates(—) | void | ios | Stops magnetometer updates. |
181
+ | isMagnetometerActive(—) | Boolean | ios | Returns a Boolean indicating whether magnetometer updates are currently happeni… |
182
+ | isMagnetometerAvailable(—) | Boolean | ios | Returns a Boolean indicating whether a magnetometer is available on the device. |
183
+ | getMagnetometerData(—) | CoreMotionMagnetometerData | ios | Returns the latest sample of magnetometer data. |
184
+
185
+
186
+ ### Related Types
187
+
188
+ #### CoreMotionMagnetometerData
189
+ > Representation of a magnetometer event.
190
+
191
+ | Property | Type | Description |
192
+ |----------|------|-------------|
193
+ | timestamp | Number | The time when the logged item is valid. |
194
+ | magneticField | CoreMotionMagneticField | The magnetic field measured by the magnetometer. |
195
+
196
+ ---
197
+
198
+ ## Modules.CoreMotion.MotionActivity
199
+ > Allows Titanium client applications to access CoreMotion's MotionActivity APIs.
200
+ > Extends Ti.Proxy
201
+ > Platforms: ios
202
+
203
+
204
+ ### Methods (4)
205
+ | Method | Returns | Platform | Description |
206
+ |--------|---------|----------|-------------|
207
+ | isActivityAvailable(—) | Boolean | ios | Returns a Boolean indicating whether motion activity data is available on the c… |
208
+ | startActivityUpdates(callback) | void | ios | Starts the delivery of current motion activity updates to your app. |
209
+ | stopActivityUpdates(—) | void | ios | Stops the delivery of motion activity updates to your app. |
210
+ | queryActivity(args, callback) | void | ios | Gathers and returns historical motion activity data for the specified time peri… |
211
+
212
+
213
+ ### Related Types
214
+
215
+ #### CoreMotionQueryActivityArgs
216
+ > Dictionary of arguments to pass to the [MotionActivity.queryActivity()](Modules.CoreMotion.MotionActivity.queryActivity) method.
217
+
218
+ | Property | Type | Description |
219
+ |----------|------|-------------|
220
+ | start | Date | The start time to use when gathering motion data. |
221
+ | end | Date | The end time to use when gathering motion data. |
222
+
223
+ ---
224
+
225
+ ## Modules.CoreMotion.Pedometer
226
+ > Allows Titanium client applications to access CoreMotion's Pedometer APIs. Note: This API is only available in iOS 8 and later.
227
+ > Extends Ti.Proxy
228
+ > Platforms: ios
229
+
230
+
231
+ ### Methods (9)
232
+ | Method | Returns | Platform | Description |
233
+ |--------|---------|----------|-------------|
234
+ | isSupported(—) | Boolean | ios | Returns a Boolean value indicating whether the pedometer is supported on the cu… |
235
+ | isCadenceAvailable(—) | Boolean | ios | Returns a Boolean value indicating whether cadence information is available on … |
236
+ | isDistanceAvailable(—) | Boolean | ios | Returns a Boolean value indicating whether distance support is available on the… |
237
+ | isFloorCountingAvailable(—) | Boolean | ios | Returns a Boolean value indicating whether floor counting is available on the c… |
238
+ | isPaceAvailable(—) | Boolean | ios | Returns a Boolean value indicating whether pace information is available on the… |
239
+ | isStepCountingAvailable(—) | Boolean | ios | Returns a Boolean indicating whether step-counting support is available on the … |
240
+ | startPedometerUpdates(args, callback) | void | ios | Starts the delivery of recent pedestrian-related data to your app. |
241
+ | stopPedometerUpdates(—) | void | ios | Stops the delivery of recent pedestrian data updates to your app. |
242
+ | queryPedometerData(args, callback) | void | ios | Retrieves the data between the specified start and end dates. |
243
+
244
+
245
+ ### Related Types
246
+
247
+ #### CoreMotionStartPedometerArgs
248
+ > Dictionary of arguments to pass to the [Pedometer.startPedometerUpdates()](Modules.CoreMotion.Pedometer.startPedometerUpdates) method.
249
+
250
+ | Property | Type | Description |
251
+ |----------|------|-------------|
252
+ | start | Date | The start time to use when gathering pedometer data. |
253
+
254
+ ---
255
+
256
+ ## Modules.CoreMotion.StepCounter
257
+ > Allows Titanium client applications to access CoreMotion's (deprecated) StepCounter APIs.
258
+ > Extends Ti.Proxy
259
+ > Platforms: ios
260
+
261
+
262
+ ### Methods (4)
263
+ | Method | Returns | Platform | Description |
264
+ |--------|---------|----------|-------------|
265
+ | isStepCountingAvailable(—) | Boolean | ios | Returns a Boolean indicating whether step-counting support is available on the … |
266
+ | startStepCountingUpdates(args, callback) | void | ios | Starts the delivery of current step-counting data to your app. |
267
+ | stopStepCountingUpdates(—) | void | ios | Stops the delivery of step-counting updates to your app. |
268
+ | queryStepCount(args, callback) | void | ios | Gathers and returns historical step count data for the specified time period. |
269
+
270
+
271
+ ### Related Types
272
+
273
+ #### CoreMotionQueryStepCountArgs
274
+ > Dictionary of arguments to pass to the [Stepcounter.queryStepCount()](Modules.CoreMotion.Stepcounter.queryStepCount) method.
275
+
276
+ | Property | Type | Description |
277
+ |----------|------|-------------|
278
+ | start | Date | The start time to use when gathering step count data. |
279
+ | end | Date | The end time to use when gathering step count data. |
280
+
281
+ #### CoreMotionStartStepCountingArgs
282
+ > Dictionary of arguments to pass to the [StepCounter.startStepCountingUpdates()](Modules.CoreMotion.Stepcounter.startStepCountingUpdates) method.
283
+
284
+ | Property | Type | Description |
285
+ |----------|------|-------------|
286
+ | stepCounts | Number | The number of steps to record before executing the callback. The number of step… |
287
+
288
+ ---
289
+
290
+ ## Modules.URLSession
291
+ > Wrapper to support iOS's NSURLSession class for background downloads.
292
+ > Extends Ti.Module
293
+ > Platforms: ios
294
+ > Type: module
295
+
296
+ These APIs are supported on iOS 7 and later.
297
+
298
+ The URL session module (`com.appcelerator.urlSession`) provides the application the ability to
299
+ download large content via HTTP while the application is in the background. With this module, you can
300
+
301
+ 1. Create a URL session and a background download task.
302
+ 2. Monitor events to check the progress of the download and session.
303
+ 3. Cancel downloads and invalidate sessions.
304
+
305
+ URL session events are monitored through the following iOS application-level events:
306
+
307
+ * <Titanium.App.iOS.backgroundtransfer>
308
+ * <Titanium.App.iOS.downloadprogress>
309
+ * <Titanium.App.iOS.downloadcompleted>
310
+ * <Titanium.App.iOS.sessioncompleted>
311
+
312
+ *(See full overview in titanium-docs)*
313
+
314
+ ### Properties (unique: 1/2)
315
+ | Property | Type | Default | Platform | Description |
316
+ |----------|------|---------|----------|-------------|
317
+ | configuration | Modules.URLSession.SessionConfiguration | — | ios | The configuration used for this url session. |
318
+
319
+
320
+ ### Methods (3)
321
+ | Method | Returns | Platform | Description |
322
+ |--------|---------|----------|-------------|
323
+ | finishTasksAndInvalidate(session) | void | ios | Invalidates the given session object, allowing any outstanding tasks to finish. |
324
+ | invalidateAndCancel(session) | void | ios | Cancels all outstanding tasks and then invalidates the session object. |
325
+ | backgroundDownloadTaskWithURL(session, url) | String | ios | Creates a download task for the specified URL, within the provided session obje… |
326
+
327
+
328
+ ---
329
+
330
+ ## Modules.URLSession.Session
331
+ > The session object used to start new tasks.
332
+ > Extends Ti.Module
333
+ > Platforms: ios
334
+ > Type: module
335
+
336
+ These APIs are supported on iOS 7 and later.
337
+
338
+ The NSURLSession class and related classes provide an API for downloading content.
339
+ This API provides a rich set of delegate methods for supporting authentication and gives
340
+ your app the ability to perform background downloads when your app is not running or, in iOS,
341
+ while your app is suspended.
342
+
343
+ [iOS Background Services guide]().
344
+
345
+ ### Properties (unique: 1/3)
346
+ | Property | Type | Default | Platform | Description |
347
+ |----------|------|---------|----------|-------------|
348
+ | configuration | Modules.URLSession.SessionConfiguration | — | ios | The configuration used for this url session. |
349
+
350
+
351
+ ### Methods (7)
352
+ | Method | Returns | Platform | Description |
353
+ |--------|---------|----------|-------------|
354
+ | finishTasksAndInvalidate(—) | void | ios | Invalidates the given session object, allowing any outstanding tasks to finish. |
355
+ | invalidateAndCancel(—) | void | ios | Cancels all outstanding tasks and then invalidates the session object. |
356
+ | downloadTask(args) | String | ios | Creates a download task for the specified URL, within the provided session obje… |
357
+ | uploadTask(args) | String | ios | Creates a upload task for the specified URL, within the provided session object… |
358
+ | dataTask(args) | String | ios | Creates a data task for the specified URL, within the provided session object a… |
359
+ | reset(callback) | void | ios | Empties all cookies, cache and credential stores, removes disk files, calls <Mo… |
360
+ | flush(callback) | void | ios | Flushes storage to disk and clear transient network caches. |
361
+
362
+
363
+ ### Related Types
364
+
365
+ #### DownloadTaskType
366
+ > The parameter for [downloadTask](Modules.URLSession.Session.downloadTask) method.
367
+
368
+ | Property | Type | Description |
369
+ |----------|------|-------------|
370
+ | url | String | The remote url used for this data task. |
371
+
372
+ #### UploadDataTaskType
373
+ > The parameter for [uploadTask](Modules.URLSession.Session.uploadTask) method.
374
+
375
+ | Property | Type | Description |
376
+ |----------|------|-------------|
377
+ | url | String | The remote url used for this data task. |
378
+ | data | Ti.Blob | The data blob used for this data task. |
379
+ | method | String | The request method (e.g. POST or PUT) |
380
+ | requestHeaders | String | Additional request headers to pass to the request. |
381
+
382
+ ---
383
+
384
+ ## Modules.URLSession.SessionConfiguration
385
+ > The session configuration object used to create new url sessions.
386
+ > Extends Ti.Module
387
+ > Platforms: ios
388
+ > Type: module
389
+
390
+ These APIs are supported on iOS 7 and later.
391
+
392
+ An NSURLSessionConfiguration object defines the behavior and policies to use
393
+ when uploading and downloading data using an URLSession object. When uploading
394
+ or downloading data, creating a configuration object is always the first step
395
+ you must take. You use this object to configure the timeout values, caching
396
+ policies, connection requirements, and other types of information that you
397
+ intend to use with your URLSession object.
398
+
399
+ [iOS Background Services guide]().
400
+
401
+ ### Properties (unique: 2/4)
402
+ | Property | Type | Default | Platform | Description |
403
+ |----------|------|---------|----------|-------------|
404
+ | identifier | String | — | ios | The unique identifier for the configuration object. |
405
+ | HTTPHeaderFields | Object | — | ios | Specifies additional headers which will be set on outgoing requests. Keys and v… |
406
+
407
+
408
+
409
+
410
+ ---
411
+