rookiedev
rookiedev

Reputation: 1127

Pinterest api for fetching pins for a user

I'm trying to integrate Pinterest into an android application and I would like to retrieve all the pins for a specific user (obviously after the user has logged in). Is this possible to be achieved by utilising the api released by Pinterest? Many thanks.

Upvotes: 0

Views: 645

Answers (1)

hornet2319
hornet2319

Reputation: 339

Yes, this is possible, check Pinterest sample app on GitHub: link

sample code:

private void fetchPins() {
    adapter.setPinList(null);
    adapter.notifyDataSetChanged();
    PDKClient.getInstance().getMyPins(PIN_FIELDS,  new PDKCallback() {
        @Override
        public void onSuccess(PDKResponse response) {
            List<PDKPin> list=new Arraylist<>;
            //getting pin list
            list=response.getPinList();

        }

        @Override
        public void onFailure(PDKException exception) {
            _loading = false;
            Log.e(getClass().getName(), exception.getDetailMessage());
        }
     }
  );
}

Happy coding!

Upvotes: 0

Related Questions