New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS: Support GDPR (APSAnalytics 2.1.0), add missing native header #10051
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to agree on the API specification for Ti.Analytics optOut because this is varying per implementation:
Ti.Analytics.optedOut // instead of Ti.Analytics.isOptedOut
Ti.Analytics.setOptedOut(boolean)
Ti.Analytics.getOptedOut()
For consistency like our other Titanium APIs
For example, the Windows implementation uses isOptOut
:
https://github.com/appcelerator/titanium_mobile_windows/pull/1238
And Android uses optedOut
:
#10058
@garymathews @ypbnv @infosia I have updated the iOS-PR to add the property |
Updated Windows PR: https://github.com/appcelerator/titanium_mobile_windows/pull/1238 Updated API doc for Windows too. |
@garymathews The PR was updated, can you re-review? I have also added @vijaysingh-axway for another CR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hansemannn Can you address the 2 points which I have mentioned. Thanks!
iphone/Classes/AnalyticsModule.m
Outdated
|
||
- (void)optedOut | ||
{ | ||
@([[APSAnalytics sharedInstance] isOptedOut]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Isn't it good if we make this method's return type to (NSNumber *) for more readability and return it.
- Following test case crashing, if I close the app and run again. Can this not be a test case ?
`var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var btn = Ti.UI.createButton({
title: 'Trigger'
});
btn.addEventListener('click', function() {
Ti.Analytics.setOptedOut(true);
});
win.add(btn);
win.open();
`
var should = require('./utilities/assertions'); | ||
|
||
describe('Titanium.Analytics', function () { | ||
it.androidMissing('.optedOut', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@garymathews @ypbnv Once Android is merged, we can update this one to work or all platforms.
@infosia I think this works on Windows already, since your tests have been pretty extensive before merging. Any objections? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR passed.
Dismissing review since the comments have been addressed earlier.
JIRA: https://jira.appcelerator.org/browse/TIMOB-26004
Adding unit test once CR approved.