This method displays the My Photo plugin, which enables users to view their account photo and to upload a new photo.
The My Photo plugin may be activated in "display" mode, which only allows displaying the current photo if it exists, or "upload" mode, which also allows photo uploading (see parameters below). The following example shows the My Photo plugin in "upload" mode, for a user who has a profile picture.
The following is an example of the My Photo plugin being used in a new user's profile screen. The user does not have a photo or a thumbnail photo in their account, and therefore the plugin displays a default photo.
The following table lists the available parameters:
|||mode||string||The mode in which the plugin should function. Possible values are:|
|||onLoad||function ref||A reference to an event handler function that will be called when the plugin has finished drawing itself.|
|||onError||function ref||A reference to an event handler function that will be called when an error occurs.|
The single argument, eventObj, contains information about the event and has different fields for different events.
Registering Event Listeners
Gigya's events are divided into two types - plugin events and global events. To register a handler for a plugin event, pass the event handler method name as an argument of the method that generates the plugin.
Registering to global events is done by calling the addEventHandlers method.
The following tables specify the list of fields available in the eventObj for each event.
Note: In some cases the event handler function may return a Boolean value. This is specified below each table.
onError Event Data
onLoad Event Data
iPhone Photo Orientation
When Gigya receives a photo, it is uploaded in the orientation it was taken, so, for instance, on an iPhone that was sideways when the photo was captured, if this photo is uploaded to Gigya prior to having it's orientation corrected, it will appear side-ways or upside down in the user's profile. See https://www.businessinsider.com/heres-why-your-iphone-photos-sometimes-appear-upside-down-2014-10 for more information.