So, if you have installed a Chatter Unfollow app from AppExchange and want to rely on its' objects:
String objectName = 'chttrunfollow__UnfollowRule__c';
String fieldName = 'chttrunfollow__Active__c';
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
Schema.SObjectType t = gd.get(objectName);
if(t != null) {
Schema.DescribeSObjectResult sobjectDescribe = t.getDescribe();
System.debug(sobjectDescribe.isAccessible());
Map<String, Schema.SObjectField> fields = sobjectDescribe.fields.getMap();
if(fields != null && fields.get(fieldName) != null && fields.get(fieldName).getDescribe().isAccessible()) {
System.debug('Show it!');
}
} else {
System.debug(LoggingLevel.ERROR, 'Not found');
}
It can be a quite expensive operation so you'd probably want to cache the results somewhere (custom setting?).
There's a System.requestVersion() call but I think it returns only "your" current version (can't use it to ask for what else was installed in given org). if you use licenses - UserInfo.isCurrentUserLicensed('namespace') might be worth checking?
Want to get certified in Salesforce? Here is the Salesforce Online Training you are looking for.