Skip to content
This repository

publishStream URLs with query strings not working #3

Closed
lauraskelton opened this Issue · 3 comments

3 participants

Laura Skelton Luke Shepard Yujuan Bao
Laura Skelton

Am I missing something? When using publishStream I want to include the URL to a specific product that includes a query string as the href for the post to link to, set in the "attachment" NSDictionary with the key "href" in the - (IBAction) publishStream: (id)sender method. It works fine if I use a URL with no query string, but if there is an ampersand in the url it doesn't send any of the data (name, caption, description, or url) to the Facebook post.

The same URL worked fine with the previous version of the Facebook iPhone sdk, and no way of escaping the & seems to work.

Luke Shepard

Thanks for the report, I've reproed the issue. We'll investigate and post an update.

Yujuan Bao

Thanks for the report. I just push in a fix which should have fix the issue. Let me know if it is working. Thanks!

Laura Skelton

Works great! Thanks for fixing.

Christine Abernathy caabernathy referenced this issue from a commit
Christine Abernathy Invalidate session only if access token errors when extending token
Summary:
Currently when there is a Platform API call that has any error or if there is a
connection error, e.g. timeout, the access token is invalidated. This was due
to
diff D378197 where any errors call invalidSession. To fix this narrow the
invalidate call to the scenario where the access token has expired when an API
call
is made.

For now, only REST API error codes allow us to easily identify an invalid token
(error code 190). A separate diff will be implemented by the Platform team
to provide an error code for Graph API auth token errors.

Test Plan:
Case #1
1/ Login
2/ Tap Graph API
3/ Tap Get your friends
4/ Go off LAN and WiFi
5/ Tap Get your friends

Case #2
1/ Turn WiFi back on
2/ Tap Get your friends
3/ See friends list
4/ Go back to get to Graph API page
5/ Remove app from https://www.facebook.com/settings/?tab=applications
6/ Tap Get your friends

Case #3
1/ Temporarily modified code to force a Graph API error
     //[[delegate facebook] requestWithGraphPath:@"me" andParams:params
andDelegate:self];
     [[delegate facebook] requestWithGraphPath:@"000000" andParams:params
andDelegate:self];
2/ Tap Graph API
3/ Tap Get your information

Before this change, here were the results
Case #1: Session expires message, which is incorrect behavior
Case #2: Session expires message, which is correct behavior
Case #3: Session expires message, which is incorrect behavior

After this change, here are the results
Case #1: Get the Hackbook "Oops something went wrong" message, which is desired
behavior
Case #2: Get the Hackbook "Oops something went wrong" message, which is not
ideal, user should also be logged out
Case #3: Get the Hackbook "Oops something went wrong" message, which is desired
behavior

Reviewers: yariv, jimbru, brent, toddkrabach, jonathan

Reviewed By: yariv

CC: lshepard, selekman, beau, bgolub, danmuriello, jacl

Differential Revision: https://phabricator.fb.com/D402481

Revert Plan: OK

Task ID: 900407
daed6b2
Deleted user Unknown referenced this issue from a commit in FiftyThree/facebook-ios-sdk
Christine Abernathy Invalidate session only if access token errors when extending token
Summary:
Currently when there is a Platform API call that has any error or if there is a
connection error, e.g. timeout, the access token is invalidated. This was due to
diff D378197 where any errors call invalidSession. To fix this narrow the
invalidate call to the scenario where the access token has expired when an API call
is made.

For now, only REST API error codes allow us to easily identify an invalid token
(error code 190). A separate diff will be implemented by the Platform team
to provide an error code for Graph API auth token errors.

Test Plan:
Case #1
1/ Login
2/ Tap Graph API
3/ Tap Get your friends
4/ Go off LAN and WiFi
5/ Tap Get your friends

Case #2
1/ Turn WiFi back on
2/ Tap Get your friends
3/ See friends list
4/ Go back to get to Graph API page
5/ Remove app from https://www.facebook.com/settings/?tab=applications
6/ Tap Get your friends

Case #3
1/ Temporarily modified code to force a Graph API error
     //[[delegate facebook] requestWithGraphPath:@"me" andParams:params
andDelegate:self];
     [[delegate facebook] requestWithGraphPath:@"000000" andParams:params
andDelegate:self];
2/ Tap Graph API
3/ Tap Get your information

Before this change, here were the results
Case #1: Session expires message, which is incorrect behavior
Case #2: Session expires message, which is correct behavior
Case #3: Session expires message, which is incorrect behavior

After this change, here are the results
Case #1: Get the Hackbook "Oops something went wrong" message, which is desired
behavior
Case #2: Get the Hackbook "Oops something went wrong" message, which is not
ideal, user should also be logged out
Case #3: Get the Hackbook "Oops something went wrong" message, which is desired
behavior

Reviewers: yariv, jimbru, brent, toddkrabach, jonathan

CC: lshepard, selekman

Differential Revision: https://phabricator.fb.com/D402481

Revert Plan: OK

Task ID: 900407
82bc92c
zewt zewt referenced this issue from a commit
zewt zewt Don't attempt native iOS login on pre-iOS 6 devices.
Calling [accountStore accountTypeWithAccountTypeIdentifier:@"com.apple.facebook"]
from the iPad 5.1 simulator causes the application to hang with this stack (tested
with JustRequestSample):

    frame #0: 0x91918c5e libsystem_kernel.dylib`semaphore_wait_trap + 10
    frame #1: 0x011b9022 libdispatch.dylib`_dispatch_semaphore_wait_slow + 108
    frame #2: 0x011b90fa libdispatch.dylib`dispatch_semaphore_wait + 36
    frame #3: 0x0011b35d Accounts`-[ACAccountStore accountTypeWithAccountTypeIdentifier:] + 199
    frame #4: 0x00014140 JustRequestSample`-[FBSession authorizeWithPermissions:defaultAudience:integratedAuth:FBAppAuth:safariAuth:fallback:isReauthorize:] + 529 at FBSession.m:893
    frame #5: 0x00013f27 JustRequestSample`-[FBSession authorizeWithPermissions:behavior:defaultAudience:isReauthorize:] + 118 at FBSession.m:839
    frame #6: 0x00012c22 JustRequestSample`-[FBSession openWithBehavior:completionHandler:] + 518 at FBSession.m:365
    frame #7: 0x000166e6 JustRequestSample`+[FBSession openActiveSessionWithPermissions:allowLoginUI:allowSystemAccount:isRead:defaultAudience:completionHandler:] + 270 at FBSession.m:1563
    frame #8: 0x000133a8 JustRequestSample`+[FBSession openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:] + 82 at FBSession.m:533
    frame #9: 0x000028e1 JustRequestSample`-[JRViewController buttonRequestClickHandler:] + 289 at JRViewController.m:103

This makes it impossible to test apps in the 5.1 simulator.  Work around this by
clearing tryIntegratedAuth on pre-6.x devices, where it's never supported anyway.

This isn't an issue on real 5.1 devices, but being able to test in the simulator
for various versions is critical.
42a6ff4
Izzy Fraimow ifraimow referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.