File: JVE.Social.pas Inheritance: TComponent ⬅ TJVESocial
This component allows the user to tweet or post to one of the supported networks; similarly to TJVEEmail, this component opens a dialog, through which the user can enter his message, while the default is provided via component properties. The properties exposed are:
- Network – chooses social network to post to: snTwitter, snFacebook and snSinaWeibo are supported.
- Text – the default text for the post.
- URL – any hyperlink to include with the post.
- Bitmap – an image to include with the post. This option is only supported in iOS.
- Embed – if web fallback is used, specifies whether the browser should be opened embedded in the app (i.e. TJVEBrowser) or externally (i.e. TJVEOpenURL).
While no events are exposed, the following methods are available:
- Open – opens the posting dialog (or external web browser, if requested).
- CanOpen – use to check whether native posting interface, if any, is available. Even if this function returns False, you can still call Open, web browser fallback will then be used. On platforms, which do not have a native interface, this function always returns True.
- CanOpen(Network) – this class function works the same way as CanOpen, but does not need an instance to be created.
The native interface is only currently available in mobile platforms; for other platforms an appropriate web page will be opened.
It should be noted that for circumstances beyond the author’s control, this component is much more stable (with regard to native interface) on real iOS devices, sometimes failing within the iOS simulator.
Example presentation (given for Twitter, other networks looks similarly) is as follows: