Janrain: User management platform for the social web

JREngageDelegate Interface Reference

The interface implemented by an object in order to receive notifications when a user authenticates or publishes an activity to their social networks. More...

List of all members.

Success notifications

Messages sent by JREngage notifying success

void jrAuthenticationDidSucceedForUser (JRDictionary auth_info, String provider)
void jrAuthenticationDidReachTokenUrl (String tokenUrl, HttpResponseHeaders response, String tokenUrlPayload, String provider)
void jrSocialDidPublishJRActivity (JRActivityObject activity, String provider)
void jrSocialDidCompletePublishing ()

Failure notifications

Messages sent by JREngage notifying failure

void jrEngageDialogDidFailToShowWithError (JREngageError error)
void jrAuthenticationDidNotComplete ()
void jrAuthenticationDidFailWithError (JREngageError error, String provider)
void jrAuthenticationCallToTokenUrlDidFail (String tokenUrl, JREngageError error, String provider)
void jrSocialDidNotCompletePublishing ()
void jrSocialPublishJRActivityDidFail (JRActivityObject activity, JREngageError error, String provider)

Detailed Description

The interface implemented by an object in order to receive notifications when a user authenticates or publishes an activity to their social networks.

The methods of this interface are invoked upon the success or failure of the Janrain Engage for Android Activities. They provide a conduit for the authenticated user's profile data, and if server-side authentication is configured, the data payload returned by your server's token URL.


Member Function Documentation

void jrAuthenticationDidSucceedForUser ( JRDictionary  auth_info,
String  provider 
)

Notifies the delegate that the user has successfully authenticated with the given provider, passing to the delegate a JRDictionary object with the user's profile data.

Parameters:
auth_infoA JRDictionary of fields containing all the information that Janrain Engage knows about the user signing in to your application. Includes the field "profile" which contains the user's profile information.
providerThe name of the provider on which the user authenticated. For a list of possible strings, please see the List of Providers
Note:
: The structure of the auth_info JRDictionary (represented here in JSON) will be like the following:
     "auth_info":
     {
       "profile":
       {
         "displayName": "brian",
         "preferredUsername": "brian",
         "url": "http:\/\/brian.myopenid.com\/",
         "providerName": "Other",
         "identifier": "http:\/\/brian.myopenid.com\/"
       }
     }
See also:
For a full description of the dictionary and its fields, please see the auth_info response section of the Janrain Engage API documentation.
void jrAuthenticationDidReachTokenUrl ( String  tokenUrl,
HttpResponseHeaders  response,
String  tokenUrlPayload,
String  provider 
)

Notifies the delegate after the library has successfully posted the Engage auth_info token to your server application's token URL, passing to the delegate the body and headers of the HTTP response from the token URL.

Parameters:
tokenUrlThe URL on the server where the token was posted and server-side authentication was completed
responseThe response headers returned from the server
tokenUrlPayloadThe response from the server
providerThe name of the provider on which the user authenticated. For a list of possible strings, please see the List of Providers
void jrSocialDidPublishJRActivity ( JRActivityObject  activity,
String  provider 
)

Notifies the delegate after the user successfully shares an activity on the given provider.

Parameters:
activityThe shared activity
providerThe name of the provider on which the user published the activity. For a list of possible strings, please see the For a list of possible strings, please see the List of Social Providers
void jrSocialDidCompletePublishing ( )

Notifies the delegate after the social publishing dialog is closed (e.g., the user presses the back button) and publishing is complete. You may receive multiple void jrSocialDidPublishJRActivity(JRActivityObject activity, String provider) messages before the dialog is closed and publishing is complete.

void jrEngageDialogDidFailToShowWithError ( JREngageError  error)

Notifies the delegate when the application invokes the display of a library Activity, but the Activity fails to start. May occur if the library failed to connect to the Engage server, or if the JRActivityObject was null, etc.

Parameters:
errorThe error that occurred during configuration
Note:
This message is only sent if your application tries to show a JREngage dialog, and not necessarily when the error occurred. For example, if the error occurred during the library's configuration with the Engage server, it will not be sent through this interface until the application attempts to display a library Activity.

The raison d'etre for this delayed delegate delivery is to allow for the possibility that an application may speculatively configure the library, but never actually invoke any library Activies. In that case, no error is delivered to the application.

void jrAuthenticationDidNotComplete ( )

Notifies the delegate that authorization was canceled for any reason other than an error. For example: The user pressed the back button, the cancelAuthentication method was called, or configuration of the library timed out.

void jrAuthenticationDidFailWithError ( JREngageError  error,
String  provider 
)

Notifies the delegate when authentication has failed and could not be recovered by the library.

Parameters:
errorThe error that occurred during authentication
providerThe name of the provider on which the user tried to authenticate. For a list of possible strings, please see the List of Providers
Note:
This message is not sent if authentication was canceled. To be notified of a canceled authentication, see jrAuthenticationDidNotComplete().
void jrAuthenticationCallToTokenUrlDidFail ( String  tokenUrl,
JREngageError  error,
String  provider 
)

Notifies the delegate when the call to the token URL has failed.

Parameters:
tokenUrlThe URL on the server where the token was posted and server-side authentication was completed
errorThe error that occurred during server-side authentication
providerThe name of the provider on which the user authenticated. For a list of possible strings, please see the List of Providers
void jrSocialDidNotCompletePublishing ( )

Notifies the delegate if social publishing was canceled for any reason other than an error. For example, the user presses the back button, any class (e.g., the JREngage delegate) calls the cancelPublishing method, or if configuration of the library times out.

void jrSocialPublishJRActivityDidFail ( JRActivityObject  activity,
JREngageError  error,
String  provider 
)

Notifies the delegate when publishing an activity failed and could not be recovered by the library.

Parameters:
activityThe activity the user was trying to share
errorThe error that occurred during publishing
providerThe name of the provider on which the user attempted to publish the activity. For a list of possible strings, please see the List of Social Providers

The documentation for this interface was generated from the following file:
  • /Users/nathan/android-code/engage.android/JREngage/src/com/janrain/android/engage/JREngageDelegate.java
Copyright © 2017 Janrain, Inc.