Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication issue with snapandrun #22

Closed
sweetie85 opened this issue Oct 26, 2011 · 33 comments
Closed

Authentication issue with snapandrun #22

sweetie85 opened this issue Oct 26, 2011 · 33 comments

Comments

@sweetie85
Copy link

Hi,

I am trying to execute iphone snapandrun, its taking me to the login page but after that its not passing teh access token.
It still at the authenticating message.

Any help is appreciated.

Thanks,
Swetha.

@lukhnos
Copy link
Owner

lukhnos commented Oct 27, 2011

Check the callback URL in your API key settings. If you're using the latest version of ObjectiveFlickr, the callback URL should already be using the new callback scheme (in which you pass the callback URL as part of token request process). So you want to double check if you have setup the URL and URL handling correctly.

@lukhnos lukhnos closed this as completed Oct 27, 2011
@sweetie85
Copy link
Author

Can you please explain in detail. I removed the callback url from the app settings. But still I have the issue.

Thanks,
Swetha.

@lukhnos
Copy link
Owner

lukhnos commented Oct 27, 2011

You have to set up your API key so that it's a "web app", with the callback URL being snapnrun://auth, because that's what SnapAndRun can handle. The app registers with iOS device/simulator the snaprun:// URL scheme.

You also want to set breakpoint/log the URL handler in the app so see if the URL does get invoked.

Another way to test is simply type snaprun://auth?12345 and see if the app launches.

@sweetie85
Copy link
Author

The app is launching for me, but after the launch the message always says authenticating.
I was able to login and grant permissions and directed to app, but in the app the message is always at authentication.

I am unable to pull images as the pull images is locked.

@lukhnos
Copy link
Owner

lukhnos commented Oct 28, 2011

What do you mean by "pull image is locked"? Do you mean the "Pick Picture" button?

You may need to supply screenshots to let people know what was exactly happening to the app you're running.

@sweetie85
Copy link
Author

Yes the "Pick Picture" button is not working and the status of authorize is "authorizing".....
I am attaching the screenshots of my workflow.

@sweetie85
Copy link
Author

Sorry I am unable to attach screenshots. Below is the list of actions that I am performing.

  1. Open app. Click on login.
  2. The app is being directed to flickr website where I login and grant permissions.
  3. After the login the app is being reopened. But the "Pick picture" button is not working....and the status stays at "Authorizing".

Thanks,
Swetha.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

Are you using the latest version of ObjectiveFlickr? Can you post the git version hash you're using? (e.g. 734c8ed) ?

@sweetie85
Copy link
Author

I am using this 734c8ed.

@sweetie85
Copy link
Author

I downloaded from https://github.com/lukhnos/objectiveflickr and I am testing on simulator. I am not sure if that makes any difference. I would greatly appreciate if you could email me with a working api key.

My email address is: koduruswetha@gmail.com

Any help is greatly appreciated as I need to finish it by today.

Thanks,
Swetha.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

Which version of iOS SDK / Xcode are you using?

Also, can you set breakpoint / do logging on this method (just search to find the files) to see if they're ever called?

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

@sweetie85
Copy link
Author

I am using xCode version Version 3.2.3.

@sweetie85
Copy link
Author

I tested with breakpoint....the below function is not being called:

  • (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

@sweetie85
Copy link
Author

How do I fix the issue, so that the above function is called. I greatly appreciate any help.

Thanks,
Swetha.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

Double check in your API key settings on Flickr, you have

(1) App type: web application
(2) Callback URL: snapnrun://auth? (you need the ending question mark too)

I tested with Xcode 4 and it works well with iPhone Simulator 4.3.

@sweetie85
Copy link
Author

Yes I have the callback url as "snapnrun://auth?", but still its not working. Sorry to ask this can I get your api key details if its ok with you.

@sweetie85
Copy link
Author

In the app there is code line which says: NSString *SRCallbackURLBaseString = @"snapnrun://auth";
should I change anything in this.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

Also, which version of iOS SDK are you targeting?

That's all the API key details I can reveal. Another thing you want to try is to delete SnapAndRun on your device/simulator, and restart everything (Reset Content on Simulator also works). Sometimes the Springboard gets confused on the app URL settings.

If that still doesn't work, you want to type the URL manually on Mobile Safari (say snap run://auth?12345) and make sure the method I mentioned above gets called. If that doesn't get call, there's something wrong with your dev system, and that's the first thing you have to figure out (write another simple app without ObjectiveFlickr to see what really happens, etc.) That's all I can think of.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

You should never reveal your API key and secret in public forum. I have removed your latest comment.

@sweetie85
Copy link
Author

Ok thanks for all your help....will let you know how it goes.

@sweetie85
Copy link
Author

I am targeting on os 3.0 and higher.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

Try targeting to 4.3 first. There might be some difference in the URL handling mechanism.

@sweetie85
Copy link
Author

should the callback url be snapnrun or snap run or snapAndrun

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

See above, it's snapnrun://auth?

@sweetie85
Copy link
Author

The IOS target is 3.0 on my xcode...do you think I have to upgrade my sdk.

@sweetie85
Copy link
Author

Do you have older version of this code which works on 3.0.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

Check out the older version of ObjectiveFlickr (like two months ago). The older version uses the older Flickr auth API, which will be phased out earlier next year.

@sweetie85
Copy link
Author

Thank you. One last question what is the method to pull the photo stream from my flickr account.

@lukhnos
Copy link
Owner

lukhnos commented Nov 7, 2011

@sweetie85
Copy link
Author

Hi,

I tried to use this api http://www.flickr.com/services/api/flickr.photos.search.html, but this api is giving me all the public photos. Can you please let me know how to pull a user private albums and photos after oauth login.

Thanks,
Swetha.

@lukhnos
Copy link
Owner

lukhnos commented Nov 10, 2011

If you're calling the API as an authenticated user, you'll be able to get the private photos.

I suggest you use http://www.flickr.com/groups/api for general API questions.

@sweetie85
Copy link
Author

Thanks

@sweetie85
Copy link
Author

Hi,

Is there a way to open flickr authentication url in uiwebview and not in safari. I created a webview and when I click authorize button the flickr is being opened in webview, but its not being closing uiwebview after authorization.

I think its because of the callback url. Can you please suggest what should I do to close the webview automatically after authentication.

Thanks,
Swetha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants