I have a managed package and I wanted to create or update tasks through Apex. We also would like to include this in managed package. While researching I found that to update WhoId field of tasks through Apex when Shared Activities are enabled we have to use "TaskRelation" object.
However, if I include "TaskRelation" object into package, the package is not getting installed on the Salesforce org where "SharedActivities" feature is not enabled.
Can anybody help me out with this? How can I handle this dynamically in package?
Thanks in advance.