Created
September 30, 2016 03:43
-
-
Save xgeek-net/e33c3baa437e492d5d2a0d48ada828f2 to your computer and use it in GitHub Desktop.
SocialApi Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact contact = [SELECT Id, Type__c, AccessToken__c FROM Contact LIMIT 1]; | |
System.assertEquals(contact.Type__c, 'Facebook'); | |
String socialType = contact.Type__c + 'Api'; | |
Type t = Type.forName(socialType); | |
SocialApi api = (SocialApi)t.newInstance(); | |
String profile = api.getProfile(contact.AccessToken__c); | |
System.assertEquals(profile, 'https://scontent.xx.fbcdn.net/xxxxxx.png'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment