[TIMOB-25618] App is unable to access Localytics method properly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-15T20:42:13.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | Escalation |
Reporter | Victor Vazquez Montero |
Assignee | Hans Knöchel |
Created | 2017-12-19T20:50:08.000+0000 |
Updated | 2018-05-15T20:43:05.000+0000 |
Description
Description:
Customer is having issues accessing Localytics method properlyCode:
We are using the Localytics SDK for Analytics and we are having issues accessing a specific method. Attached is the pod file that we are using. We are using the setOptions method to set the "max_monitoring_regions" option in our titanium app but it does not work. Below is the code snippet. Can you check if we are using the method in the right way with the right arguments? Code:
var TiApp = require('Titanium/TiApp');
var Localytics = require("Localytics/Localytics");
console.log("launction options are " + Localytics + localyticsKey);
Localytics.autoIntegrateLaunchOptions(³APP_KEY", TiApp.app.launchOptions);
Localytics.setLoggingEnabled(true);
var options = { "max_monitoring_regions" : 2 };
Localytics.setOptions(options);
Podfile:
{quote}install! 'cocoapods', :integrate_targets => false platform :ios, '7.0' target 'myWorkplace' do pod 'LocalyticsStaticFramework', '~> 4.2' end {quote}Request:
Can you see any issues in their implementation or have any changes been made in hyperloop that they need to address in the implementation?Attachments
File | Date | Size |
---|---|---|
beaconcrash.txt | 2018-02-21T23:09:33.000+0000 | 1025317 |
com.abc.localytics-iphone-1.0.0.zip | 2018-04-29T07:13:46.000+0000 | 7069307 |
index.js | 2018-01-25T20:45:08.000+0000 | 49214 |
iOSBeacon.js | 2018-01-25T20:45:07.000+0000 | 5806 |
iOSBeaconCrashLog.txt | 2018-01-25T20:45:09.000+0000 | 7522403 |
localytics_module_error_log.txt | 2018-04-27T19:38:40.000+0000 | 1005765 |
Localytics.h | 2017-12-20T20:58:25.000+0000 | 52437 |
LogOutput.txt | 2018-02-13T23:43:25.000+0000 | 686275 |
WorkplaceSvc_Dev__2-5-18_12-44_PM.crash | 2018-02-05T17:56:13.000+0000 | 55509 |
WorkplaceSvc_Dev.app.dSYM.zip | 2018-02-21T23:09:38.000+0000 | 6673163 |
WorkplaceSvc_Dev 2-13-18, 5-17 PM.crash | 2018-02-13T23:43:24.000+0000 | 62211 |
WorkplaceSvc_Dev 2-21-18, 4-49 PM.crash | 2018-02-21T23:09:33.000+0000 | 83731 |
[[~emerriman], Can you please take a look at this. Its a pressing issue for ABC.
cc [~pkalita] [~arohini] I don't know if the localytics sdk is supported by us or not. Is there any other information as to what is not working ? The ticket just mentions a code snippet but it is not clear what behavior they are seeing and why they are saying it is not working ?
[~spulipakkam] they are doubtful the that method names passed through hyperloop are being implemented correctly. Is there any way to map out for them what the Method names would be?
[^Localytics.h] [~emerriman] I am not sure if we do something like this (see comment from Victor above). I have attached the Localytics method signatures i got from their sdk. [~vvazquezmontero] I still feel the ticket needs more info. Have they used localytics sdk with hyperloop before ? Are they moving to a new localytics sdk version ( 3 to 4) . What kind of error are they seeing ? If we have not done this kind of mapping for any other native library i don't understand why we would need to do it for localytics?
[~spulipakkam]I will ask those questions to the customer but according to them we have done this for them before and it is expected from us.
[~vvazquezmontero] If we have done that for them before wouldn't it be for a subset or specific method signatures. Localytics is not a small sdk it is a lot of methods! If [~emerriman] confirms that this is something we would be able to do then i think we should ask the customer to give us a list of methods they would be using. I don't think we should be spending time on documenting the entire localytics sdk. They(localytic) themselves have not documented their APIs well.
[~vvazquezmontero], [~spulipakkam] the methods names are definitely correct, otherwise Hyperloop would throw an error at runtime that there is no such method. A quick debugging shows that the methods indeed reach the native side, but for some reason they don't show the expected behavior.
Localytics.setLoggingEnabled(true)
for example should enable the logging, but no log messages from Localytics are seen after making this call. Further investigating this right now.@Victor Vazquez Montero, @Srinivasan Pulipakkam , @Jan Vennemann , @Pooja Kalita we have been using localytics for long time now. Till now we have used init method, tagscreen, tagevent, set profile these methods are working fine for now. we have always used localytics static framework 4.2. I hope this helps.
[~morahman], [~emerriman]. did some more debugging and i couldn't find a reason why it does not work for the customer with this specific method yet. I tried several other methods and all of them seem to work as expected. As [~patilamrut] mentioned, they are also using Localytics successfully. The logging issues i mentioned in my previous comment are likely related to the way we retrieve logs. I verified with
Localytics.isLoggingEnabled
that the logging is actually enabled after callingLocalytics.setLoggingEnabled(true)
, they just don't show up. I'll ping [~cbarber] on this to see if the he has any idea why this is happening. I even created a native module to verify that it's not in any way related to Hyperloop since it shows the same behavior. While we further validate the logging issues, is it possible to get more details from the customer about the exact issue?Localytics.setOptions
is not documented anywhere except for one [Help Article](https://help.localytics.com/t/how-can-i-use-localytics-side-by-side-with-another-geofencing-or-beacon-service/400). Is there an easy way for us to verify the iOS monitoring limitations?We have created a native iOS project with localytics SDK and Estimote beacon SDK. With that we are able to use localytics setoptions method and use estimote sdk to monitor beacon. This proves that issue is clearly with hyperloop. As if i use hyperloop i cannot use setoptions method.
Hello [~jvennemann] Amerisource has come back with a query: {quote}Based on our testing, the "Localytics.integrate("API_KEY")" does not send the analytics data to Localytics. We have not received any analytics data since the update we made yesterday. We are trying couple other methods that supplement the "Loclaytics.integrate()" method as mentioned in the Localytics documentation and testing it. I will keep updating our progress in this ticket. Please let us know if you have any insight in this matter. We request you to close this case after we confirm.{quote}
[~vvazquezmontero], after further investigation of this issue we think this not related to Hyperloop but rather an incompatibility of the used beacon module and Localytics auto integration. To test it they can use the following code, which replaces their iosBeaconLocator with a complete Hyperloop implementation:
This will work with
Localytics.autoIntegrateLaunchOptions
and includes all delegate methods required for monitoring and ranging beacons. Another minor note: They only use the When-In-Use Authorization style where monitoring regions is not allowed. However, for the sake of completeness, the above code snippet also has monitoring delegates setup. This also means that Localytics.setOptions() is not necessary since Localytics cannot monitor regions and their code only uses ranging.Hey Jan, I've shared that with the customer and will update you once then confirm
[~jvennemann] they are now facing crashes while using the app: {quote}Hello Team, Thanks for providing the Hyperloop beacon source code for iOS. We implemented the source code in the project and the beacon monitoring started to work. Although, the iOS app was crashing with a SIGSEGV error after opening the app and staying in it for sometime (less than 2 min of navigating in the app). Attached are the crash details and the files that we changed. Also, per Jan's suggestion, I also added the "AlwaysUse" authorization for location.
Steps to replicate the crash: - Use the below code and run the app - The app requests user for location permission - On granting permission, the app monitors beacons and displays the beacon information if it finds one - Navigate to the app by selecting the location (Valley forge) - Tap on 'View Schedule' - After you go through few screens, the app crashes. There is no specific screen/point/flow where the app crashes. On observing the crash logs, it seems to be a SIGSEGV error. Please let us know if we are missing anything.{quote} Files: [^index.js] [^iOSBeacon.js] [^iOSBeaconCrashLog.txt]
[~jvennemann] Is there any update here? The customer is asking for updates.
Looking into it right now! I'll keep you posted once i know more.
[~vvazquezmontero], [~mrahman], a couple of questions as i'm not able to reproduce the crash in my environment. - Did the crash only occur after changes to the code in index.js? - There is a minor bug in my initial beacon locator implementation which results in the beacon proximity always being "unknown". I was too optimistic and thought destructuring would work. To fix it they have to replace line 5 in iosBeaconLocator.js with
- Can they provide a full crash report as a
.crash
file? The plain device log makes it hard to exactly identify where it crashed in JavaScriptCore.[~jvennemann] Can you provide me what you see on your end and the app version and the environment (QA/Dev) that you’re pointing you? Request from customer
[~jvennemann] They were able to resolve the issues they were seeing on friday through a call but now they are seeing a crash and have shared the crash report: [^WorkplaceSvc_Dev__2-5-18_12-44_PM.crash]
Thanks [~vvazquezmontero], that helps a lot! Looking into it now.
[~jvennemann] do we have anything to share with the customer?
Hello [~jvennemann] they have provided the logs needed and also commented: Also, just an FYI - we are targeting the app to use the latest 7.0.2 SDK. Just want to ensure that the latest hyperloop has the updates needed for this issue. [^beaconcrash.txt] [^WorkplaceSvc_Dev 2-21-18, 4-49 PM.crash] [^WorkplaceSvc_Dev.app.dSYM.zip] let me know if you need anything else.
[~amukherjee] Can we pls make this a priority?
[~arohini] The issue we have is that Jan is our only developer who has the the knowledge deep enough to fix it. Hans proposed a workaround, and I'll work with him tomorrow to test it. But for an actual fix, it won't be until next week at the earliest when Jan gets back
I have updated the official Localytics module based on the changes [~gmathews] made before by: - updating the Localytics SDK to 5.1.0 (latest) - adding
startMonitoring(callback)
andstopMonitoring()
to the module API This allows you to use beacon monitoring without additional modules. It's nearly 1:1 the Hyperloop implementation in native code. I have also made a pull request against the official Localytics repository and it contains the new module binary (com.localytics-iphone-5.1.0.zip): https://github.com/localytics/localytics-titanium/pull/6 P.S.: Checking out the PR locally will also fix the error seen before ("invalid bitcode signature") that I addressed. *EDIT*: I have made a test app that is successfully able to range beacons:It uses the above module and can be downloaded [here](https://www.dropbox.com/s/vfam1mxn0atnhbk/test_localytics.zip?dl=1). I assume this should resolve all remaining issues regarding beacons. If there is more hands on help needed, please let me know. Thanks!