zyra / cordova-plugin-pinterest

Cordova plugin for Pinterest
MIT License
10 stars 2 forks source link

Can't create new pin on iOS, working fine on android #2

Open tonystaa opened 6 years ago

tonystaa commented 6 years ago

Successfully logged in Pinterest on iOS Successfully fetched Pinterest boards list on iOS But can not create new pin createPin(note, boardId, imageUrl, link, onSuccess, onError)

and also no callback is called(neither onSuccess nor onError)

my actual code

cordova.plugins.Pinterest.createPin(

"Heloo there", 

"807551845621954609", 

"https://ichef-1.bbci.co.uk/news/660/cpsprodpb/1325A/production/_88762487_junk_food.jpg" , 

"www.google.com",

function(result){
    alert("Succesfully pinned your post")
}, 

function(error){
    alert("Error while pinning your post")
})

The same code is working absolutely fine on android. This is the screenshot of pinterest website(I successfully pinned it from android emulator using above code) :

pinterest pin

ionic Version : 1.3.1

please ask for any other information required.

ihadeed commented 6 years ago

Thanks for reporting this.

I can't tell what the issue here is.

tonystaa commented 6 years ago

I have checked all the function on iOS, and found that all the functions are working fine except these two functions:

createPin(note, boardId, imageUrl, link, onSuccess, onError) getBoardPins(boardId, onSuccess, onError, fields, limit)

I have already told you about createPin method. code i used for getBoardPins()

cordova.plugins.Pinterest.getMyBoards(function (success) {
    debugger
    cordova.plugins.Pinterest.getBoardPins(success[0].id, function (s) {
        debugger
    }, function (e) {
        debugger
    })
}, function (error) {
    debugger
})

No debugger is being hit on iOS. I have checked multiple times on two different Macbook . Also I reinstalled the plugin twice.But nothing worked. Please check the above functions.

Also, getMyLikes(onSuccess, onError, fields, limit)

is throwing error on both android and iOS

message:"404: Not Found"
type:"http"

But may be it's beacuse i dont have any likes yet.

Everything is working fine on android.

oosswwaalldd commented 6 years ago

Hi!

How did you manage to install this plugin in an Ionic project? at iOS compilation time it gives me "PDKResponseObject.h" file does not exist.

Some help needed please, i am following the instructions on https://ionicframework.com/docs/native/pinterest/

Here is my Ionic info command output:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.15.2
ionic (Ionic CLI) : 3.15.2

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : ios 4.5.2
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 25.2.2
ios-deploy        : 1.9.2
Node              : v8.8.1
npm               : 5.5.1
OS                : macOS High Sierra
Xcode             : Xcode 9.1 Build version 9B55

Environment Variables:

ANDROID_HOME : /Users/tuity/Library/Android/sdk

Misc:

backend : legacy

Thanks in advance

tonystaa commented 6 years ago

Hi @oosswwaalldd I got the same issue while trying to install it second time in iOS, there was a mix-up of plugin errors, I got various other ".h" file error for other plugins also. what i did was: deleted all the plugins which are causing those errors using command:

cordova plugin list - this will list all the installed plugins

cordova plugin remove <NAME-OF-PLUGIN> - remove all the plugins which are causing error

then i removed both the platform android and iOS(yes, i removed android platform while running it on iOS)

ionic cordova platform remove ios ionic cordova platform remove android

IMPORTANT: Restart the terminal if any of the steps fails or give error.

I then installed pinterest plugin again using command : cordova plugin add cordova-plugin-pinterest --variable APP_ID=YOUR_APP_ID (which is on github page) then run using: ionic cordova emulate ios

oosswwaalldd commented 6 years ago

@tonystaa thanks, I've tried that but i am still having the same error, I thinks it is the cocoa pods not installing after the plugin installation

chiemekailo commented 5 years ago

Please how did you handle your Redirect URI? An issue is open here for it, but no response at all. But it is working for you, so please could you respond to that issue.?