Closed G00fY2 closed 2 years ago
setEnabledFeatures will do a set operation (replace with what you pass in) while enable
and disable
will mutate your current set of features. Anything calls before setEnabledFeatures
should not be needed. We will update the docs on this. Thanks for the feedback.
The changes from 25bfcd6 really help making the usage clear. Thanks for updating the javadocs! 👍
Hi everyone,
Preliminary Info
What Airship dependencies are you using?
we are currently using
com.urbanairship.android:urbanairship-fcm
in the latest version 15.0.0.Report
We migrated to the new PrivacyManager while updating to 14.5.0 before. Everything seems to be working fine so far. But we have discussions about some public APIs of the PrivacyManager with our Android team as well as our colleagues maintaining the iOS part. I will only reference the Android APIs in this issue. But you should consider checking if there are similar obscurity in your iOS SDK.
What unexpected behavior are you seeing? / What is the expected behavior?
We use the following 3 methods of the PrivacyManager to enable or disable Airship in the user settings of our app:
public void enable(@Feature int... features)
This one is pretty clear. It enables additional features without changing other features. Thats also what the documentation in the source code says:public void disable(@Feature int... features)
This one is also pretty clear. It should disable the passed features without changing other features. But the documentation is wrong for this one. It also says:public void setEnabledFeatures(@Feature int... features)
The method name and the documentation aren't really helpful. If the user disables Airship we want to disable all features butFEATURE_IN_APP_AUTOMATION
,FEATURE_MESSAGE_CENTER
,FEATURE_PUSH
. From going through the source codesetEnabledFeatures
will first useFEATURE_NONE
flag as a base and combine the features to it. So it basically disables all features except the features passed in, right? So callingdisable(FEATURE_ALL)
before is not required? Maybe you could make this clear in the documentation.What are the steps to reproduce the unexpected behavior?
N/A
Do you have logging for the issue?
N/A
Thanks in advance.