It’s fine if it’s opt-in. Most developers simply assume consent, however, which has all of the normal problems that come along with assuming consent in any context (ie your assumption being wrong in a significant number of cases and the completely avoidable consent violations that occur thereby).