Mani BAtra
Mani BAtra

Reputation: 50

Handling Incoming Requests (Facebook iOS SDK)

I am of the knowledge that the following method only gets implemented when the app is opened via the Facebook flow i.e. via a notification in the facebook iOS app

      - (BOOL)application:(UIApplication *)application 
                  openURL:(NSURL *)url
        sourceApplication:(NSString *)sourceApplication 
               annotation:(id)annotation 
        {
           return [FBSession.activeSession handleOpenURL:url]; 
        }

The url received in this method is used for handling incoming requests sent by another user. I had a few questions regarding the same.

  1. So does that mean that the handling of the requests cant be tested on iOS simulator as there is no facebook app installed?

  2. Or if the functionality can be tested using Safari on the simulator, do we need to have an iPhone app store id so that our app can be redirected to from the browser?

  3. Consequently does that mean no testing of incoming request without an iTunes Connect account?

Upvotes: 0

Views: 436

Answers (1)

jverrijt
jverrijt

Reputation: 696

  1. That depends on what you mean by requests. You can write a test app that calls the custom URL scheme you define or test it from within Safari. If by 'requests' you mean push notifications, this would be a good way to simulate them. Push notifications are unsupported by the simulator however. You will an iOS device to test them.

  2. See above. When you create a link, like a regular HTML anchor, to a custom url scheme and the application that's "listening" for these url's is installed, it will be opened when the user presses the link. e.g.<a href="yourapp://path/?bar=1&foo=2">Link</a>

  3. Perhaps you can elaborate on what you mean with 'incoming requests'. If you are referring to push-notifications then yes, you will need a developer account to be able to test push-notifications. Also, they would only work on hardware and not in the simulator. You could then look into ways of simulating notifications as I described above.

Upvotes: 1

Related Questions