Janrain: User management platform for the social web

JRActivityObject Class Reference

An activity object you create, populate, and post to the user's activity stream. More...

#import <JRActivityObject.h>

Inherits NSObject.

List of all members.

Properties

The various properties of the JRActivityObject that you can configure.

NSString * action
NSString * url
NSString * userGeneratedContent
NSString * resourceTitle
NSString * resourceDescription
NSArray * actionLinks
NSArray * media
NSDictionary * properties
JREmailObjectemail
JRSmsObjectsms
Deprecated Properties

The following properties have been deprecated.

NSString * user_generated_content
NSString * title
NSString * description
NSArray * action_links

Constructors



(id) - initWithAction:andUrl:
(id) - initWithAction:
(id) + activityObjectWithAction:andUrl:
(id) + activityObjectWithAction:

Detailed Description

An activity object you create, populate, and post to the user's activity stream.

Create an activity object, fill in the object's fields, and pass the object to the JREngage library when you are ready to publish. Currently supported providers are:

  • Facebook
  • LinkedIn
  • Twitter
  • MySpace
  • Yahoo!

Janrain Engage will make a best effort to use all of the fields submitted in the activity request, but note that how they get presented (and which ones are used) ultimately depends on the provider.

This API will work if and only if:

  • Your Janrain Engage application has been configured with the given provider
  • The user has already authenticated and has given consent to publish activity

Otherwise, you will be given an error response indicating what was wrong. Detailed error responses will also be given if the activity parameter does not meet the formatting requirements described below.

See also:
For more information of Janrain Engage's activity api, see the activity section of our API Documentation.

Member Function Documentation

- (id) initWithAction: (NSString*)  action
andUrl: (NSString*)  url 

Returns a JRActivityObject initialized with the given action and url.

Parameters:
action A string describing what the user did, written in the third person. This value cannot be nil
url The URL of the resource being mentioned in the activity update. The URL must be an NSString* representation of a well-formed URL, with a scheme and host. They cannot be an empty string or nil. If these conditions are not met, the JRActivityObject.url property will be set to nil
Returns:
A JRActivityObject initialized with the given action and url. If action is nil, returns nil
- (id) initWithAction: (NSString*)  action  

Returns a JRActivityObject initialized with the given action.

Parameters:
action A string describing what the user did, written in the third person. This value cannot be nil
Returns:
A JRActivityObject initialized with the given action. If action is nil, returns nil

Properties

- (NSString*) action [read, assign]

A string describing what the user did, written in the third person (e.g., "wrote a restaurant review", "posted a comment", "took a quiz").

- (NSString *) url [read, write, copy]

The URL of the resource being mentioned in the activity update. The URL must be an NSString* representation of a well-formed URL, with a scheme and host. They cannot be an empty string or nil. If these conditions are not met, the JRActivityObject.url property will be set to nil.

- (NSString*) userGeneratedContent [read, write, copy]

A string containing user-supplied content, such as a comment or the first paragraph of an article that the user wrote.

Note:
This property will likely be changed by the user when sharing. If no comment is supplied to the JRActivityObject, and the user does not update this property when sharing, this value is replaced by the JRActivityObject.action for most providers. Some providers (Twitter in particular) may truncate this value.
- (NSString*) resourceTitle [read, write, copy]

The title of the resource being mentioned in the activity update.

Note:
No length restriction on the status is imposed by Janrain Engage, however Yahoo truncates this value to 256 characters.
- (NSString*) resourceDescription [read, write, copy]

A description of the resource mentioned in the activity update.

- (NSArray *) actionLinks [read, write, copy]

An array of JRActionLink objects, each having two attributes: text and href. An action link is a link a user can use to take action on an activity update on the provider.

Example:
 action_links:
 [
   {
     "text": "Rate this quiz result",
     "href": "http://example.com/quiz/12345/result/6789/rate"
   },
   {
     "text": "Take this quiz",
     "href": "http://example.com/quiz/12345/take"
   }
 ]
Note:
Any objects added to this array that are not of type JRActionLink will be ignored.
- (NSArray *) media [read, write, copy]

An array of objects with base class JRMediaObject (i.e., JRImageMediaObject, JRFlashMediaObject, JRMp3MediaObject).

To publish attached media objects with your activity, create the preferred object, populate the object's fields, then add the object to the media array. You can attach pictures, videos, and mp3s to your activity, although how the media objects get presented and whether or not they are used, depend on the provider.

If you include more than one media type in the array, JREngage will choose only one of these types, in this order:

  1. image
  2. flash
  3. mp3

Also, any objects added to this array that are not of type JRMediaObject will be ignored.

See also:
Media object format and rules are identical to those described on the Facebook Developer page on Attachments.
- (NSDictionary*) properties [read, write, copy]

An object with attributes describing properties of the update. An attribute value can be a string or an object with two attributes, text and href.

Example:
   properties:
   {
       "Time": "05:00",
       "Location":
       {
           "text": "Portland",
           "href": "http://en.wikipedia.org/wiki/Portland,_Oregon"
       }
   }
- (JREmailObject*) email [read, write, copy]

An object containing the subject and message body of an email, if the user wishes to share via email.

- (JRSmsObject*) sms [read, write, copy]

An object containing the message body of an sms, if the user wishes to share via sms.

- (NSString *) user_generated_content [read, write, copy]
Deprecated:
Please use the JRActivityObject.userGeneratedContent property instead.
- (NSString *) title [read, write, copy]
Deprecated:
Please use the JRActivityObject.resourceTitle property instead.
- (NSString *) description [read, write, copy]
Deprecated:
Please use the JRActivityObject.resourceDescription property instead.
- (NSArray *) action_links [read, write, copy]
Deprecated:
Please use the JRActivityObject.actionLinks property instead.

The documentation for this class was generated from the following files:
  • /Users/lillialexis/iPhone/engage.iphone/JREngage/classes/JRActivityObject.h
  • /Users/lillialexis/iPhone/engage.iphone/JREngage/classes/JRActivityObject.m
Copyright © 2017 Janrain, Inc.