actions on google - request_sync for manual refresh - actions-on-google

i've implemented the request_sync - however i've only got it triggered from an EXEC and a QUERY.
How do you implement it for a user manually refreshing their devices in the app?

REQUEST_SYNC is an ordinary HTTP API that you have full control over calling as the app developer. When it is called, it triggers a new SYNC event from the HomeGraph, allowing you to return the full list of user's devices again. You can tie it to any sort of app-based event you want, whether it happens when the page reloads, when the user presses a refresh button, or anything else.

Related

How to achieve pull to refresh functionality in android like native facebook android app

I have implemented pull to refresh functionality in my application. It refreshes the list if I pull it down.
But my requirement is to show auto refreshing list, as user navigates to that screen every time. Means list will refresh automatically as in native Face-book application.
So please help me by any idea or code to achieve this.
Two thoughts:
You could use a timer and have your app refresh every few minutes.
You could implement something much more complicated that uses something like GCM (Google Cloud Messaging) that would notify the app that there is new data to be refreshed. You would also probably want to only notify the user while they have the app open.

Facebook authorisation: Handeling cancellation

I am building an app, which uses facebook authorisation services. However, I am facing problems in two cases
The user is sent to the facebook app for giving permission. Instead, she presses the home button and again opens my app.
In this case, I need to do two things:
a. Re-show her the login page (and remove the animation from that page): For this I need to know that the user has come back to the app without logging into fb.
b. Cancel the last request sent to fb: If user tries to login again, my app sends two requests to the fb authorisation system, which leads to two popup windows in the fb app and also gives back multiple calls to my app.
The user presses the cancel button: In this case fb app is not re-directing to my app. I read that this was a bug and has been fixed; however, this still this does not work for me. Any suggestions?
I have tried to search for similar Q on the forum; however, have not been able to find exact answer. Please let me know if I missed looking at relevant question.
If you're using the Facebook SDK 3.1 for iOS, then
- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSession.activeSession handleDidBecomeActive];
}
Will cancel the auth request if the user happened to cancel the auth flow via doing something like hitting the Home button. You can then reset by showing your login view again.
The (2) problem should be fixed if you upgrade to the latest Facebook iOS app.

App - Displaying different pages on the Page Tab and the Landing Page

I am trying to make a FB app which does the following:
i) The app is present on the page Tab. When the user click the pageTab, she is shown a screen[A1] where she can invite her friends to this app.
ii) When the friend gets the notification, she sees another screen [A2] which tells about the app.
What are the ways to do this?
I was wondering if there is a way to identify the source of the requests (other than the url on browser) to differentiate between the two requests to the Apps so that I can render the appropriate screens [A1] or [A2] based on if it is clicked from the PageTab or directly the invite notification.
Thank you.
See https://developers.facebook.com/docs/requests/, section „Accepting a User Request” – your app will get the request id(s), and can then read out the details of the request(s).
If the pure fact that the user came by your app following a request notification isn’t enough for you in your scenario, you can also pass an additional data parameter while making the request, read that out when processing the request, and let your app react accordingly.
And remember that it is your responsibility to delete requests once the user has acted upon them. (Also described in detail in the documentation.)

Detect Frictionless Request UI Popup

I am trying to create a request flow in our canvas app that uses frictionless requests to allow sending requests while in fullscreen.
The problem I don't see a solution for is how to detect when sending a request will pop up a UI dialog, and when it will not. If I send a request specifically to one or more users, and any one of them does not yet have frictionless requests turned on, I will need to break out of fullscreen so that the FB UI dialog can show.
However, if the user has previously sent requests and checked the frictionless checkbox, we don't need to break out of fullscreen.
How do I know whether or not a UI dialog is going to show? At first I thought that the hideFlashCallback could be used, but it seems like this is only fired for Facebook elements such as the notification panel, not for dialogs that the app itself initiates.
Thanks in advance for any assistance or ideas! I know that there are games on FB that handle this properly, but I cannot figure out how they are doing it.
As far as I'm aware there is no way to detect this via the API. You may be able to detect it in the DOM but you'd be opening yourself up for breakage with FB updates by using undocumented features.
What you could try is setting a timeout to break fullscreen and if your callback gets a response right away then you could cancel it. You'd have to fudge the timeout's duration based on how long the API usually takes to do the callback in frictionless requests but you could probably get this working with something like 250 or 500 milliseconds.

iPhone Facebook Application Login Problem

I am trying to implement Facebook functionality on iPhone using Facebook API. In my application I can open the Login screen, but when I enter Email and password and press "Connect" button there nothing is to be happen. And after sometimes I will be back in my previous screen. I have used FBConnect bundle. I can't understand why I cannot login in Facebook? Even I get that login screen but that connect button cannot do anything.
Please help me...
You need to post your code, so we can see how you have attempted this.
From what you have explained though, it seems like you're not implementing the delegate call back for the login dialogue. You need to implement
- (void)session:(FBSession *)session didLogin:(FBUID)uid;
and possibly these two methods as well.
- (void)dialogDidSucceed:(FBDialog *)dialog;
- (void)dialogDidCancel:(FBDialog *)dialog;
They are the call backs your session delegate object will receive when certain actions have been completed.