Reputation: 5157
I use a URL scheme to open my app and parse the query string from the URL in -didFinishLaunchingWithOptions:
. This works great, but it doesn't parse the new string when the app becomes active. I have implemented the -handleOpenURL:
and openURL methods as follows, but neither seems to be called when the app becomes active...
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
if (!url)
return NO;
queryStrings = [self parseQueryString:[url query]];
return YES;
}
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
if (!url)
return NO;
queryStrings = [self parseQueryString:[url query]];
return YES;
}
Please help! Thanks!
Upvotes: 4
Views: 5153
Reputation: 6093
To clarify the above accepted answer. You probably want to use this (I was confused by the accepted answer as it only includes the function you need and not what you need to include inside the function):
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication withSession:[PFFacebookUtils session]];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBAppCall handleDidBecomeActiveWithSession:[PFFacebookUtils session]];
}
I personally came to this issue through the Ray Wenderlich tutorial. There are also some good tutorials using Parse which show how to integrate the two.
The full tutorial this leads up to and from this point can be found here: https://parse.com/tutorials/integrating-facebook-in-ios
Hopefully this helps lessen confusion around this issue :)
Upvotes: 0
Reputation: 31294
handleOpenURL
is deprecated on iOS 5: you should be using application:openURL:sourceApplication:annotation:
instead - have you got an application:openURL
method in your app as well? If not, add one and see if it gets picked up.
Upvotes: 0
Reputation: 10104
Use:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
The method you're using is deprecated.
Upvotes: 9