With our new module created, we need to create three specific items to fulfill the contract provided by the Sunago API module. We need SocialMediaPreferencesController, SocialMediaClient, and SocialMediaItem.
Our SocialMediaPreferencesController instance is InstagramPreferencesController. It has the same getTab() method required by the interface, which is as follows:
public Tab getTab() { if (tab == null) { tab = new Tab(); tab.setText("Instagram"); tab.setContent(getNode()); } return tab; } private Node getNode() { Node node = instagram.isAuthenticated() ? buildConfigurationUI() : buildConnectUI(); return node; }
To save time and space, for this example, we've left the Instagram implementation much more ...