cordova-plugin-pinterest
Cordova plugin for Pinterest
Platforms
This plugin supports Android and iOS
Installation
cordova plugin add cordova-plugin-pinterest // or cordova plugin add https://github.com/zyramedia/cordova-plugin-pinterest
Usage
You can access the plugins functions via the global variable cordova.plugins.Pinterest
.
Example
{ console;} { console;} var scopes = cordovapluginsPinterestSCOPESREAD_PUBLIC cordovapluginsPinterestSCOPESWRITE_PUBLIC cordovapluginsPinterestSCOPESREAD_RELATIONSHIPS cordovapluginsPinterestSCOPESWRITE_RELATIONSHIPS; // lets login firstcordovapluginsPinterest; // after logging in, we can perform any other function// for the sake of a clean example, this code is here, but you should wait for the login function to succeed firstcordovapluginsPinterest;
Methods
login
- scopes: List of permissions to request. You can use
cordova.plugins.Pinterest.SCOPES
constants for convenience. Available permissions are:read_public
,write_public
,read_relationships
,write_relationships
.
Logs the user in. The response object will contain the user's profile data, as well as the access token (if you need to use it elsewhere, example: send it to your server and perform actions on behalf of the user).
getMe
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
Gets the authenticated user's profile.
getMyPins
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
- limit: (optional) Limit the number of items returned. Capped to 100. Defaults to 100.
Gets the authenticated user's Pins.
getMyBoards
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
- limit: (optional) Limit the number of items returned. Capped to 100. Defaults to 100.
Get the authenticated user's boards.
getMyLikes
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
- limit: (optional) Limit the number of items returned. Capped to 100. Defaults to 100.
Get the authenticated user's likes.
getMyFollowers
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
- limit: (optional) Limit the number of items returned. Capped to 100. Defaults to 100.
Get the authenticated user's followers.
getMyFollowedBoards
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
- limit: (optional) Limit the number of items returned. Capped to 100. Defaults to 100.
Get the authenticated user's followed boards.
getMyFollowedInterests
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
- limit: (optional) Limit the number of items returned. Capped to 100. Defaults to 100.
Get the authenticated user's followed interests.
getUser
- username: Username of the user
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
Get a user's profile.
getBoard
- boardId: The ID of the board
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
Get a board's data.
getBoardPins
- boardId: The ID of the board
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
- limit: (optional) Limit the number of items returned. Capped to 100. Defaults to 100.
Get Pins of a specific board.
deleteBoard
- boardId: The ID of the board
Delete a board.
createBoard
- name: Name of the board
- desc: (optional) Description of the board
Create a new board for the authenticated user.
getPin
- pinId: The ID of the Pin
- fields: (optional) Fields to retrieve, separated by commas. Defaults to all available fields.
Get a Pin by ID.
deletePin
- pinId: The ID of the Pin
Delete a Pin.
createPin
- note: Note/Description of the Pin
- boardId: Board ID to put the Pin under
- imageUrl: URL of the image to share
- link: (optional) Link to share
Create a Pin for the authenticated user.
Quirks
- This plugin does not provide any pagination features. You are limited only to the latest 100 entries and you cannot fetch the next pages. This can be fixed but it will make this API more complicated. It can be added if demanded by many users.