Public Member Functions
Osp::Social::Services::SnsGateway Class Reference
Inheritance diagram for Osp::Social::Services::SnsGateway:
Osp::Base::Object

Deprecated:
This class is deprecated due to the operation policy of the bada Server.
Since:
1.0

The following diagram illustrates the relationships between the classes belonging to the Social namespace.

social_sns_gateway_using_the_apis_classdiagram.png

An SnsGateway defines the interfaces to external social networking services. In version 1.0, the supported service providers are Twitter and Facebook, and MySpace.

Authentication is needed to access the service providers. See the SnsAuthenticator. In version 1.0, the OAuth authentication is available and it is used for Twitter and MySpace. The Facebook Connect authentication is also available. SnsGateway needs SnsAuthResult which contains the consumer key, consumer secret, token key and token secret as a result of authentication described on OAuth specification. More information on the OAuth specification can be found at http://www.oauth.net. The SnsAuthResult can be obtained using Osp::Social::Services::SnsAuthenticator. After the authentication on the service provider, the SnsGateway::AddAuthResult() method has to be called to successfully call other methods of SnsGateway. SnsGateway uses the value of SnsAuthResult to access the user's resource on the specific service provider.

The authentication result will be stored in the application folder of the device when SnsGateway::AddAuthResult() is called.
Therefore, the authentication result need not be added every time the user uses the application.

When the authentication result is stored, the user information can be accessed without adding the authentication result after creating the instance of SnsGateway.
The session resumes based on the previously added authentication result.
The session cannot be resumed if the session of the service provider has expired or if the user has revoked the authentication.
In these cases, you may receive an error message such as "Unauthorized".
To remove the stored authentication result of a specific service provider, call SnsGateway::RemoveAuthResult().

Remarks:
Only one result is stored for one service provider. If you add a new result without removing the previous one, the new result overwrites the previous one.

In version 1.0, following feature are supported:

Feature Twitter Facebook MySpace
Get my buddy list O(following) O O
Get user status text O O O
Set my status text O O O
Get user profile O O O
Get activities O(tweets) O O
Get photos by photo ID - O -
Get photos of a specific user - - O(Logged-in user's only)
Get photo album list of a specific user - O O
Get photos in a specific album - O O
Upload photo - O O


In version 1.2, the following feature is added:

Feature Twitter Facebook MySpace
Publish a post - O -


You can access the methods of a service provider that are not supported in this SnsGateway even if that method requires authentication. The token key and the token secret of SnsAuthResult is also available on the specific service provider.

Social_Services_SnsGateway_diagram.png
Remarks:
1. The value of the parameter serviceProvider of each method has to be small character, like "twitter", "facebook", and "myspaceid".
2. In case of MySpace, the parameter seviceProvider has to be "myspaceid".

See the code snippets for information on how to use the SnsGateway methods.

Osp::Social::Services::SnsGateway::GetMyBuddies()
Osp::Social::Services::SnsGateway::UpdateMyStatusText()
Osp::Social::Services::SnsGateway::GetPhotoAlbums()
Osp::Social::Services::SnsGateway::GetPhotosInAlbum()
Osp::Social::Services::SnsGateway::GetPhotosByUser()
Osp::Social::Services::SnsGateway::UploadPhoto()

List of all members.

Public Member Functions

result AddAuthResult (const Osp::Social::Services::SnsAuthResult &snsAuthResult)
result Construct (const ISnsGatewayListener &gatewayListener, const ISnsContentListener *pContentListener, const ISnsPeopleListener *pPeopleListener, const ISnsActivityListener *pActivityListener)
result Construct (const ISnsGatewayListener &gatewayListener, const ISnsContentListener *pContentListener, const ISnsPeopleListener *pPeopleListener, const ISnsActivityListener *pActivityListener, const ISnsPostListener *pPostListener)
result GetActivities (const Osp::Base::String &serviceProvider, const Osp::Base::String *pActivityOwner, const SnsPagingParam &pagingParam, RequestId &reqId)
result GetMyBuddies (const Osp::Base::String &serviceProvider, SnsPagingParam &pagingParam, RequestId &reqId)
result GetPhoto (const Osp::Base::String &serviceProvider, const Osp::Base::String *pPhotoOwnerId, const Osp::Base::String &photoId, RequestId &reqId)
result GetPhotoAlbums (const Osp::Base::String &serviceProvider, const Osp::Base::String *pAlbumOwnerId, SnsPagingParam &pagingParam, RequestId &reqId)
result GetPhotosByUser (const Osp::Base::String &serviceProvider, const Osp::Base::String *pSnsUserId, SnsPagingParam &pagingParam, RequestId &reqId)
result GetPhotosInAlbum (const Osp::Base::String &serviceProvider, const Osp::Base::String *pAlbumOwnerId, const Osp::Base::String &albumId, SnsPagingParam &pagingParam, RequestId &reqId)
result GetProfile (const Osp::Base::String &serviceProvider, const Osp::Base::String *pSnsUserId, RequestId &reqId)
result GetStatusText (const Osp::Base::String &serviceProvider, const Osp::Base::String *pSnsUserId, RequestId &reqId)
result IsLoggedIn (const Osp::Base::String &serviceProvider, RequestId &reqId)
result PublishPost (const Osp::Base::String &serviceProvider, const SnsPostInfo &postInfo, RequestId &reqId)
result RemoveAuthResult (const Osp::Base::String &serviceProvider)
 SnsGateway (void)
result UpdateMyStatusText (const Osp::Base::String &serviceProvider, const Osp::Base::String &statusText, RequestId &reqId)
result UploadPhoto (const Osp::Base::String &serviceProvider, const Osp::Base::String *pAlbumId, const SnsUploadContentInfo &contentInfo, RequestId &reqId)
virtual ~SnsGateway (void)

Constructor & Destructor Documentation

Osp::Social::Services::SnsGateway::SnsGateway ( void  )

This is the default constructor for this class.
This creates an uninitialized instance of SnsGateway.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Remarks:
After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
See also:
Construct()
virtual Osp::Social::Services::SnsGateway::~SnsGateway ( void  ) [virtual]

This is the destructor for this class.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0

Member Function Documentation

result Osp::Social::Services::SnsGateway::AddAuthResult ( const Osp::Social::Services::SnsAuthResult snsAuthResult)

Adds the authentication result of the specific service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]snsAuthResultThe authentication result
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_INVALID_ARGThe specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
See also:
Construct()
SnsAuthenticator
SnsAuthResult
result Osp::Social::Services::SnsGateway::Construct ( const ISnsGatewayListener gatewayListener,
const ISnsContentListener pContentListener,
const ISnsPeopleListener pPeopleListener,
const ISnsActivityListener pActivityListener,
const ISnsPostListener pPostListener 
)

Initializes this instance of SnsGateway with the specified listeners.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.2
Returns:
An error code
Parameters:
[in]gatewayListenerThe event listener
This listener is mandatory as it receives the response of IsLoggedIn().
[in]pContentListenerThe listener for receiving the response of content-related methods from the server
This listener is optional as it receives the response of a request related to a photo.
[in]pPeopleListenerThe listener for receiving the response of people-related methods from the server
This listener is optional as it receives the response of a request related to a buddy, profile, and status text.
[in]pActivityListenerThe listener for receiving the response of activity-related methods from the server
This listener is optional as it receives the response of a request related to an activity.
[in]pPostListenerThe listener for receiving the response of post-related methods from the server
This listener is optional as it receives the response of a request related to a post.
Exceptions:
E_SUCCESSThe method is successful.
E_OUT_OF_MEMORYThe memory is insufficient.
E_INVALID_STATEThis instance has already been constructed.
result Osp::Social::Services::SnsGateway::Construct ( const ISnsGatewayListener gatewayListener,
const ISnsContentListener pContentListener,
const ISnsPeopleListener pPeopleListener,
const ISnsActivityListener pActivityListener 
)

Initializes this instance of SnsGateway with the specified listeners.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Returns:
An error code
Parameters:
[in]gatewayListenerThe event listener
This listener is mandatory as it receives the response of IsLoggedIn().
[in]pContentListenerThe listener for receiving the response of content-related methods from the server
This listener is optional as it receives the response of a request related to a photo.
[in]pPeopleListenerThe listener for receiving the response of people-related methods from the server
This listener is optional as it receives the response of a request related to a buddy, profile, and status text.
[in]pActivityListenerThe listener for receiving the response of activity-related methods from the server
This listener is optional as it receives the response of a request related to an activity.
Exceptions:
E_SUCCESSThe method is successful.
E_OUT_OF_MEMORYThe memory is insufficient.
E_INVALID_STATEThis instance has already been constructed.
result Osp::Social::Services::SnsGateway::GetActivities ( const Osp::Base::String serviceProvider,
const Osp::Base::String pActivityOwner,
const SnsPagingParam pagingParam,
RequestId reqId 
)

Gets the activities of the users specified by the owner for a specific service provider.
The owner can be "All" or the specific snsUserId.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pActivityOwnerThe owner of activity
The parameter is set to null to get the activities of the logged-in user.
The parameter is set to all if you want to get the activities of the logged-in user and logged-in user's friends.
The parameter is set to snsUserId if you want to get the activity of some user.
[in]pagingParamThe SnsPagingParam instance that indicates the page number and maximum count of result items in the page
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGEither of the following conditions has occurred:
  • The specified serviceProvider is an empty string.
  • The specified pActivityOwner is an empty string.
  • A proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use SnsGateway::GetMyBuddies() method to get a user ID for the buddy.
See also:
Construct()
Osp::Social::Services::ISnsActivityListener::OnSnsActivitiesReceivedN()
Osp::Social::Services::SnsActivity
result Osp::Social::Services::SnsGateway::GetMyBuddies ( const Osp::Base::String serviceProvider,
SnsPagingParam pagingParam,
RequestId reqId 
)

Gets the buddies of the signed-in user from the specified service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pagingParamThe SnsPagingParam instance that indicates the page number and maximum number of result items on the page
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
See also:
Construct()
Osp::Social::Services::ISnsPeopleListener::OnMySnsBuddiesReceivedN()
Osp::Social::Services::SnsProfile


The following example demonstrates how to use this method:

 void
 MyClass::GetBuddies(void)
 {
    result r = E_SUCCESS;
    RequestId reqId;
    String providerName = L"twitter";

    SnsPagingParam pagingParam(5);

    r = pSnsGateway->GetMyBuddies(providerName, pagingParam, reqId);

 }


 void
 MySnsPeopleListener::OnMySnsBuddiesReceivedN(RequestId reqId, Osp::Base::Collection::IList* pBuddyProfileList,
        bool hasNext, SnsPagingParam& pagingParam, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMsg)
 {
    IEnumerator* pEnum = null;
    SnsProfile* pProfile = null;
    String buddyName;

    if (r != E_SUCCESS)
    {
    // Do something for an error.
    }

    if (pBuddyProfileList)
    {
    // Do something.
      pEnum = pBuddyProfileList->GetEnumeratorN();
      while (true)
      {
        if (pEnum->MoveNext() == E_OUT_OF_RANGE)
        {
          break;
        }
        pProfile = (SnsProfile*)pEnum->GetCurrent();
        if (pProfile == null)
        {
            // Do something for an error.
        }
        r = pProfile->GetValue(SNS_PROFILE_PID_USER_NAME, buddyName);
        // Check result.

        // Do something more.
      }
     delete pEnum;
   }

    // Deletes the list and deallocates the memory
    pBuddyProfileList->RemoveAll(true);
    delete pBuddyProfileList;
 }
result Osp::Social::Services::SnsGateway::GetPhoto ( const Osp::Base::String serviceProvider,
const Osp::Base::String pPhotoOwnerId,
const Osp::Base::String photoId,
RequestId reqId 
)

Gets the photo by specific photoId.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pPhotoOwnerIdThe user ID who owns the photo,
else set to null if the photo is that of the logged-in user
[in]photoIdThe photo ID to be got
[out]reqIdThe ID of the request
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use the SnsGateway::GetPhotosByUser() method or SnsGateway::GetPhotosInAlbum() method to get a photo ID and the user ID of the photo owner.
See also:
Construct()
ISnsContentListener::OnSnsPhotoReceived()
SnsPhotoInfo
result Osp::Social::Services::SnsGateway::GetPhotoAlbums ( const Osp::Base::String serviceProvider,
const Osp::Base::String pAlbumOwnerId,
SnsPagingParam pagingParam,
RequestId reqId 
)

Gets a list of the albums of the user from the specified service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pAlbumOwnerIdThe ID of the user whose album is required,
set to null if the album required is of the signed-in user
[in]pagingParamThe SnsPagingParam instance that indicates the page number and the maximum number of result items on a page
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider or albumId is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use the SnsGateway::GetMyBuddies() method to get an album owner's user ID.
See also:
Construct()
ISnsContentListener::OnSnsPhotoAlbumsReceivedN()
Osp::Social::Services::SnsAlbumInfo


The following example demonstrates how to use this method:

 void
 MyClass::GetMyPhotoAlbums(void)
 {
    result r = E_SUCCESS;
    RequestId reqId;
    SnsPagingParam pagingParam(5);

    r = pSnsGateway->GetPhotoAlbums(L"facebook", null, pagingParam, reqId);

 }

 void
 MyClass::GetBuddyPhotoAlbums(SnsProfile* pBuddyProfile)
 {
    result r = E_SUCCESS;
    RequestId reqId;
    String snsUserId = pBuddyProfile->GetSnsUserId();
    String serviceProvider = pBuddyProfile->GetServiceProvider();

    SnsPagingParam pagingParam(5);

    r = pSnsGateway->GetPhotoAlbums(serviceProvider, &snsUserId, pagingParam, reqId);

 }
result Osp::Social::Services::SnsGateway::GetPhotosByUser ( const Osp::Base::String serviceProvider,
const Osp::Base::String pSnsUserId,
SnsPagingParam pagingParam,
RequestId reqId 
)

Gets the photos belonging to the user specified by snsUserId.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pSnsUserIdThe ID of the user who owns the photos,
else set to null if the photos are owned by the signed-in user
[in]pagingParamThe SnsPagingParam instance that indicates the page number and maximum number of result items on the page
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use SnsGateway::GetMyBuddies() method to get a user ID for the buddy.
See also:
Construct()
Osp::Social::Services::ISnsContentListener::OnSnsPhotosByUserReceivedN()
Osp::Social::Services::SnsPhotoInfo


The following example demonstrates how to use this method:

 void
 MyClass::GetBuddyPhotos(SnsProfile* pSnsBuddyProfile)
 {
    result r = E_SUCCESS;
    RequestId reqId;

    String providerName = pSnsBuddyProfile->GetServiceProvider();
    String buddyId = pSnsBuddyProfile->GetSnsUserId();

    SnsPagingParam pagingParam(5);

    r = pSnsGateway->GetPhotosByUser(providerName, &buddyId, pagingParam, reqId);

 }


 void
 MySnsContentListener::OnSnsPhotosByUserReceivedN(RequestId reqId, Osp::Base::Collection::IList* pPhotoList,
     bool hasNext, SnsPagingParam& pagingParam, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMsg)
 {
    IEnumerator* pEnum = null;
    SnsPhotoInfo* pPhoto = null;
    String title;

    if (r != E_SUCCESS)
    {
    // Do something for an error.
    }

    if (pPhotoList)
    {
    // Do something (show photo list or get image).
      pEnum = pPhotoList->GetEnumeratorN();
      while (true)
      {
        if (pEnum->MoveNext() == E_OUT_OF_RANGE)
        {
          break;
        }
        pPhoto = (SnsPhotoInfo*)pEnum->GetCurrent();
        if (pPhoto == null)
        {
            // Do something for an error.
        }
        r = pPhoto->GetValue(SNS_PHOTO_PID_TITLE, title);
        // Check result.

        // Do something more.
      }
     delete pEnum;
   }

    // Deletes the list and deallocates the memory.
    pPhotoList->RemoveAll(true);
    delete pPhotoList;
 }
result Osp::Social::Services::SnsGateway::GetPhotosInAlbum ( const Osp::Base::String serviceProvider,
const Osp::Base::String pAlbumOwnerId,
const Osp::Base::String albumId,
SnsPagingParam pagingParam,
RequestId reqId 
)

Gets the photos in the specified album of the user identified by the specified snsUserId.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pAlbumOwnerIdThe ID of the user owning the photo album,
else set to null if the album belongs to the signed-in user
[in]albumIdThe album ID
[in]pagingParamThe SnsPagingParam instance that indicates the page number and the maximum number of result items on a page
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider or albumId is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use SnsGateway::GetPhotoAlbums() method to get an album ID and an album owner's user ID.
See also:
Construct()
Osp::Social::Services::ISnsContentListener::OnSnsPhotosInAlbumReceivedN()
Osp::Social::Services::SnsPhotoInfo


The following example demonstrates how to use this method:

 void
 MyClass::GetBuddyPhotosInAlbum(SnsAlbumInfo *pAlbum)
 {
    result r = E_SUCCESS;
    RequestId reqId;
    String snsUserId;
    String albumId;
    String serviceProvider;
    SnsPagingParam pagingParam(5);

    r = pAlbum->GetValue(SNS_ALBUM_PID_OWNER_ID, snsUserId);
    albumId = pAlbum->GetAlbumId();
    serviceProvider = pAlbum->GetServiceProvider();

    r = pSnsGateway->GetPhotosInAlbum(serviceProvider, &snsUserId, albumId, pagingParam, reqId);

 }
result Osp::Social::Services::SnsGateway::GetProfile ( const Osp::Base::String serviceProvider,
const Osp::Base::String pSnsUserId,
RequestId reqId 
)

Gets the profile of the users specified by the snsUserId for a specific service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pSnsUserIdThe Sns user ID,
else set to null if the profile is of the logged-in user
[out]reqIdThe ID of the request
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use SnsGateway::GetMyBuddies() method to get a user ID for the buddy.
See also:
Construct()
Osp::Social::Services::ISnsPeopleListener::OnSnsProfileReceived()
Osp::Social::Services::SnsProfile
result Osp::Social::Services::SnsGateway::GetStatusText ( const Osp::Base::String serviceProvider,
const Osp::Base::String pSnsUserId,
RequestId reqId 
)

Gets the status text of the specified user on the specified service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pSnsUserIdThe snsUserId of the user,
else set to null if the status of the sign-in user is required
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use SnsGateway::GetMyBuddies() method to get a user ID for the buddy.
See also:
Construct()
Osp::Social::Services::ISnsPeopleListener::OnSnsStatusTextReceived()
Osp::Social::Services::SnsStatusText
result Osp::Social::Services::SnsGateway::IsLoggedIn ( const Osp::Base::String serviceProvider,
RequestId reqId 
)

Gets the sign-in status for the specified service provider.
This method checks whether the added authentication result is currently valid or not.
If ISnsGatewayListener::OnSnsLoggedInStatusReceived() returns false, it means that the user authentication is needed for the specific service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGThe specified serviceProvider is an empty string.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
See also:
Construct()
ISnsGatewayListener::OnSnsLoggedInStatusReceived()
result Osp::Social::Services::SnsGateway::PublishPost ( const Osp::Base::String serviceProvider,
const SnsPostInfo postInfo,
RequestId reqId 
)

Publishes the post to the specified service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.2
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]postInfoThe SnsPostInfo instance that contains the information of the post to be published
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet or,
the sign-in process has not finished.
E_INVALID_ARGThe specified serviceProvider is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
The available service provider is Facebook.
See also:
Construct()
Osp::Social::Services::ISnsPostListener::OnSnsPostPublished()
Osp::Social::Services::SnsPostInfo
result Osp::Social::Services::SnsGateway::RemoveAuthResult ( const Osp::Base::String serviceProvider)

Removes the authentication result of the service provider.
The token key and token secret of the specific service provider are not expired.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_INVALID_ARGThe specified serviceProvider is an empty string.
E_OUT_OF_MEMORYThe memory is insufficient.
See also:
Construct()
result Osp::Social::Services::SnsGateway::UpdateMyStatusText ( const Osp::Base::String serviceProvider,
const Osp::Base::String statusText,
RequestId reqId 
)

Sets the status text to the specified service provider.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]statusTextThe status text to update
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGThe specified serviceProvider or statusText is an empty string, or
a proper listener is not registered.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
See also:
Construct()
ISnsPeopleListener::OnMySnsStatusTextUpdated()


The following example demonstrates how to use this method:

 void MyClass::UpdateStatusText(void)
 {
    result r = E_SUCCESS;
    RequestId reqId;
    String serviceProvider = L"twitter";
    String statusText = L"Hello, bada!";

    r = pSnsGateway->UpdateMyStatusText(serviceProvider, statusText, reqId);
 }
result Osp::Social::Services::SnsGateway::UploadPhoto ( const Osp::Base::String serviceProvider,
const Osp::Base::String pAlbumId,
const SnsUploadContentInfo contentInfo,
RequestId reqId 
)

Uploads a photo to a specific service provider.
The content type and the source file path must be set in SnsUploadContentInfo instance.
The album ID is optional. If you want to upload a photo to the specific user created album of serviceProvider, the pAlbumId has to be set. If you want to upload a photo to the common album, the albumId should be set to null.

Deprecated:
This method is deprecated due to the operation policy of the bada Server.
Since:
1.0
Privilege level:
NORMAL
Privilege group:
SNS_SERVICE
Returns:
An error code
Parameters:
[in]serviceProviderThe service provider
[in]pAlbumIdThe destination album ID
[in]contentInfoThe information of the content to be uploaded
[out]reqIdThe ID of the request
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet, or
the sign-in is not completed.
E_INVALID_ARGEither of the following conditions has occurred:
  • The mandatory properties are not set in the specified contentInfo.
  • The specified serviceProvider or pAlbumId parameter has an empty string.
  • A proper listener is not registered.
E_FILE_NOT_FOUNDThe source file is not found.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
Use SnsGateway::GetPhotoAlbums() method to get an album ID.
See also:
Construct()
Osp::Social::Services::ISnsContentListener::OnSnsPhotoUploaded()
Osp::Social::Services::SnsUploadContentInfo


The following example demonstrates how to use this method:

 void
 MyClass::UploadPhotoToProvider(String filePath)
 {
    result r = E_SUCCESS;
    RequestId reqId;
    String serviceProvider = L"facebook";
    SnsUploadContentInfo* pContent = new SnsUploadContentInfo(SNS_UPLOAD_CONTENT_PHOTO, filePath);

    pContent->SetValue(SNS_CONTENT_PID_TITLE, L"trip");

    r = pSnsGateway->UploadPhoto(serviceProvider, null, *pContent, reqId);

    delete pContent;
 }

The documentation for this class was generated from the following file:

Copyright © 2011 Samsung Electronics Co., Ltd. All rights reserved.