Request ID is not available when App Launches after clicking Facebook notification - objective-c

A Facebook app is setup with iOS native app enabled with bundle id and App Store Id of another app.
Following are possible in the current scenario.
1.Sending an app request to a friend,
2.The request badge appears in the friend's Facebook,
3. And clicking on the request launches my app.
This was the link i referred to implement this.
https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/#protip3
I am supposed to get a NSURL from these functions
– application:openURL:sourceApplication:annotation:
OR
– application:handleOpenURL:
and the expected format is as follows.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/[APP_NAME_SPACE]/?request_ids=
[COMMA_SEPARATED_REQUESTIDs]&ref=notif&app_request_type=user_to_user
Here the request_ids contains The id of app request send, and which can be used to get the data attached to the App Request.
Now my issue is that, I am not getting the NSURL in expected form, instead I get the following format. So I am unable to find or use the request_ids.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/application.php?id=442634372448098

Related

Parsing ActionCodeSettings in iOS via dynamic link

I'm trying to direct the user directly back to my iOS app when they sign up for a new Firebase account and click on the verification link in their email, but I'm unable to access the parameters generated in the ActionCodeSettings.
I'm doing this via a dynamic link, and it does redirect the user back to my app, but the url params are not exposed. I have tried the AppDelegate code from the Firebase documentation here, but no luck.
I've seen mention of an applyActionCode method in Swift but if I can't even surface the query string from the link then there's nothing for me to pass to that method anyway.
Anyone ever deal with this before?

How to know app was installed through firebase dynamic link in didFinishLaunchingWithOptions?

I am implementing firebase dynamic links in my iOS app and I can already parse the link, redirect to AppStore etc. Now I want to distinguish the first run of the app, when user installs it from the dynamic link - I want to skip the intro and show him the content that is expected to be shown.
Is there a way to know how the app is opened before being in didFinishLaunchingWithOptions?
The method application:openURL:options: will be called when Firebase Dynamic Links iOS SDK finished retrieving the pending (deferred) dynamic link.
If pending dynamic link is found, the object [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url] will have non-nil property url. The url will be equal to your deep link, that user tapped while your App was not installed. If link is not found, this property will be nil.
I suggest you to show "loading screen" in your didFinishLaunchingWithOptions. When Firebase Dynamic Links SDK will pass you result, you can proceed with custom onboarding if pending dynamic link is found. Or default onboarding if pending dynamic link is not found. Keep in mind, if network is slow, this may take some time. You may want to have timeout set to X seconds, to not hold your user too long at "loading screen".
Documentation about receiving Firebase Dynamic Links on iOS https://firebase.google.com/docs/dynamic-links/ios/receive

Facebook invitation request is not delivered

I am showing a dialog in an iOS app to allow users to select some friends to whom send an invitation to the app.
The dialog is displayed, you can select some friends and press send.
Dialog delegate method callback is called successfuly.
So far so good, but the friend is not receiving any invitation,
is that because the app is still in development?
This is the code I am using to show the dialog, is there any missing parameter?
(access token is fine because the app works).
// Show the UI Dialog
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
kFacebookAppID,#"access_token", #"Invitation message", #"message",nil];
[facebook dialog:#"apprequests"andParams:params andDelegate:self];
Requests are only delivered if the user can reasonably be expected to accept them; if your app is only an iOS app (i.e no canvas implementation / apps.facebook.com URL) then they'll only be displayed in the Facebook app for iOS.
If this isn't happening it may be because your SSO settings for the app aren't correct, so Facebook's app doesn't know how to bring users to your app when they accept the request, check those first - making sure the URL handler is set up correctly in your app, etc.
It may also be because the app is in sandbox mode, but i'm not sure about that one.

need help to get Facebook profile picture. Also is GRAPH Api online test site down?

I followed the instructions from github.com/facebook/facebook-ios-sdk
and can get Facebook login dialog and get connected. It's for ipad application to get FB info. user name, friend list can be fetched correctly.
I tried to get the profile picture
[_facebook requestWithGraphPath:#"me/picture" andDelegate:self];
and received response:There was a problem communicating with server...
but similar calls like
[_facebook requestWithGraphPath:#"me/posts" andDelegate:self];
[_facebook requestWithGraphPath:#"me/friends" andDelegate:self];
work just fine.
also tried the facebook graph API online test site:
https://developers.facebook.com/tools/explorer/
to use it, first get access token, then tried to get posts, friends, and they are fine.
but when to get picture will take forever, and never return anything.
I did log into my facebook account in a web browser and the profile picture appears just fine.
The Graph API for the user endpoint is described here:
http://developers.facebook.com/docs/reference/api/user/
About the picture connection, it says:
HTTP 302 redirect to URL of the user's profile picture (use ?type=square | small | normal | large to request a different photo).
So what you get is not the typical JSON response, but the picture itself (via the HTTP redirect). You can try that by entering the graph API call into your browser location bar. For example, to see the profile pic of Mark Zuckerberg, try:
http://graph.facebook.com/markzuckerberg/picture

Swap the application in Objective-C?

I'm developing iPad application I need to integrate third party project(Source code) with my code like i have a button in my code, when i click on the button it landed to third party application page then navigate around and vice verrsa. what is the best way to swap the app?
Regards,
Sri
Use the url schema.
See add custom URL Schema using http://
Every Application can have customer url schemas. Like ...
yourapp://someting?withparams=1.
To get they running you have to change your Info.plist to inform the iOS that your app is handling that url schema. See the SO post above.
When another App calls that URL your app gets opened and you get a hook on your app delegate.
check http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899
and:
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIApplicationDelegate
Also look here:
http://wiki.akosma.com/IPhone_URL_Schemes