{ "id": "171815", "key": "MOD-2434", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10034", "key": "MOD", "name": "Appcelerator Modules", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2018-06-19T22:25:43.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-20T04:32:57.000+0000", "status": { "description": "Submitted for code review", "name": "In Review", "id": "10003", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "components": [], "description": "Hello,\r\n\r\nWe have a feature request to update the Android module with beacon monitoring. They have tried the Android localytics module and added the localytics.xml file in the /app/platform/android/res/values directory.\r\n\r\nThe library was initiated as shown below. It fails calling to find the method - startMonitoring\r\n\r\n{code}//Initialization of library: \r\nAlloy.Globals.localytics = require('com.localytics'); \r\nAlloy.Globals.localytics.autoIntegrate(); \r\n \r\n//Start beacon monitoring: \r\nAlloy.Globals.localytics.startMonitoring(handleProximity); {code}\r\n\r\nMessage: Uncaught TypeError: Alloy.Globals.localytics.startMonitoring is not a function.\r\n\r\nThey would like to get the startMonitoring method on Android localytics module.\r\n\r\nNote: they are using the module from [Here|https://github.com/localytics/localytics-titanium/pull/6]\r\n\r\nThanks", "attachment": [], "flagged": false, "summary": "Android: need to implement Android Beacon monitoring on Localytics module", "creator": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Android, Android Beacon monitoring, Localytics module, startMonitoring", "comment": { "comments": [ { "id": "438537", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I recommend they use https://github.com/garymathews/liferay-android-beacons/releases/download/2.0/com.liferay.beacons-android-2.0.zip\r\n\r\n*EXAMPLE*\r\n{code:xml}\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n{code}\r\n{code:js}\r\nconst beacons = Ti.Platform.name === 'android' ? require('com.liferay.beacons') : null;\r\n\r\nif (beacons) {\r\n\r\n // obtain location permissions\r\n Ti.Android.requestPermissions([ 'android.permission.ACCESS_FINE_LOCATION' ], (e) => {\r\n if (e.success) {\r\n\r\n // wait for beacons library to be ready\r\n let handle = setInterval(() => {\r\n if(!beacons.isReady()) return;\r\n clearInterval(handle);\r\n handle = null;\r\n\r\n // listen for beacon proximity events\r\n beacons.addEventListener('beaconProximity', (e) => {\r\n const identifier = e.source.identifier,\r\n uuid = e.source.uuid,\r\n power = e.source.power;\r\n\r\n Ti.API.info(`identifier: ${identifier}, uuid: ${uuid}, power: ${power}`);\r\n });\r\n\r\n // monitor for our specific beacons\r\n beacons.startMonitoringForRegion({\r\n identifier: 'iBeacon',\r\n uuid: '1ED323F5-E1CB-6B4C-2418-B8D760237BDE'\r\n });\r\n beacons.startMonitoringForRegion({\r\n identifier: 'iBeacon',\r\n uuid: 'B9407F30-F5F8-466E-AFF9-25556B57FE6D'\r\n });\r\n\r\n }, 1000);\r\n } else {\r\n Ti.API.error(e.error);\r\n }\r\n });\r\n}\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-19T23:34:04.000+0000", "updated": "2018-06-19T23:35:55.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }